#!/bin/bash ################################## # Author1: Bruno Goncalves (www.biglinux.com.br) # Author2: Barnabé di Kartola # Author3: Rafael Ruscher (rruscher@gmail.com) # Date: 2023/10/28 # # Description: BigLinux Snapshot Detect and Restore # # Licensed by GPL V2 or greater ################################## export TEXTDOMAINDIR="/usr/share/locale" export TEXTDOMAIN=grub-btrfs-timeshift snapDate=$(sed -E 's|.*timeshift-btrfs/snapshots/([^ @/]*).*|\1|' /proc/cmdline) txtRestore=$"RESTAURAR" txtReboot=$"REINICIAR" txtSnapshot=$"Snapshot" txtBack=$"Voltar" if [ ! -e "$HOME/.config/bigbashview_lightmode" ]; then # Read background color KDE_BG_COLOR="$(kreadconfig5 --group "Colors:Window" --key BackgroundNormal | sed 's|^|(|g;s|,|+|g;s|$|)/3|g' | bc)" # Verify if is light or not if [ "$KDE_BG_COLOR" -gt "127" ]; then changeBody="" else changeBody="" fi else if [ "$(cat "$HOME/.config/bigbashview_lightmode")" = "1" ]; then changeBody="" else changeBody="" fi fi if [[ "$execute" = "restore" ]]; then pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY KDE_SESSION_VERSION=5 KDE_FULL_SESSION=true "/usr/local/bin/restore-snapshot-in-use" --yes 2> /dev/null > /dev/null if [[ "$?" = "0" ]]; then msg=$"Restauração concluída!
Reinicie o sistema.

" fontSize=" bold large-text" button="" timeshiftName="
" else msg=$"A restauração não foi concluída!" fontSize=" bold large-text" button="" timeshiftName="" fi else timeshiftName="Timeshift" fontSize="large-text" msg=$"O sistema foi iniciado a partir de um ponto de restauração, também chamado de Snapshot.

Se você deseja tornar esse ponto de restauração o padrão de início do sistema, clique no botão Restaurar ou utilize o Timeshift para mais opções." button="" timeshiftButton="" fi read -d $"" ShowText < $changeBody
$timeshiftName

$msg

$timeshiftButton $button
EOF echo "$ShowText"