Hyprland-dotfiles/scripts/installtimeshift.sh

43 lines
1.2 KiB
Bash
Raw Normal View History

2024-02-19 03:00:59 -05:00
#!/bin/bash
# _____ _ _ _ __ _
# |_ _(_)_ __ ___ ___ ___| |__ (_)/ _| |_
# | | | | '_ ` _ \ / _ \/ __| '_ \| | |_| __|
# | | | | | | | | | __/\__ \ | | | | _| |_
# |_| |_|_| |_| |_|\___||___/_| |_|_|_| \__|
#
sleep 1
clear
figlet "Timeshift"
_isInstalledYay() {
package="$1";
check="$(yay -Qs --color always "${package}" | grep "local" | grep "${package} ")";
if [ -n "${check}" ] ; then
echo 0; #'0' means 'true' in Bash
return; #true
fi;
echo 1; #'1' means 'false' in Bash
return; #false
}
2024-02-27 05:16:40 -05:00
timeshift_installed=$(_isInstalledYay "timeshift")
grubbtrfs_installed=$(_isInstalledYay "grub-btrfs")
if [[ $timeshift_installed == "0" ]] ;then
2024-02-19 03:00:59 -05:00
echo ":: Timeshift is already installed"
else
if gum confirm "DO YOU WANT TO INSTALL Timeshift now?" ;then
yay -S timeshift
fi
2024-02-27 05:16:40 -05:00
fi
if [[ -d /boot/grub ]] && [[ $grubbtrfs_installed == "0" ]] ;then
echo ":: grub-btrfs is already installed"
else
echo ":: grub-btrfs is required to select a snapshot on grub bootloader."
if gum confirm "DO YOU WANT TO INSTALL grub-btrfs now?" ;then
yay -S grub-btrfs
fi
fi
sleep 3