39 lines
1.2 KiB
Bash
39 lines
1.2 KiB
Bash
source /etc/nixos/other/colors.sh
|
|
FLAG_FILE="/home/cookiez/.flags/theme-flag"
|
|
|
|
/run/current-system/sw/bin/konsave -i /etc/nixos/plasma/theme.knsv
|
|
/run/current-system/sw/bin/konsave -i /etc/nixos/plasma/theme.knsv
|
|
/run/current-system/sw/bin/konsave -a theme
|
|
|
|
progress_bar() {
|
|
local duration=$1
|
|
local interval=0.25
|
|
local total_intervals=$((duration / interval))
|
|
local progress=""
|
|
local bar_length=10
|
|
|
|
for ((i=0; i<total_intervals; i++)); do
|
|
progress="${progress}-"
|
|
printf "\rApplying: [%-${bar_length}s]" "$progress"
|
|
sleep $interval
|
|
done
|
|
echo -ne "\r[${progress}] Done!\n"
|
|
}
|
|
|
|
mkdir -p "$(dirname "$FLAG_FILE")"
|
|
touch "$FLAG_FILE"
|
|
echo "Flag for knowing weather the Default theme packaged with this NixOS install was actually applied! (If this exists than it should be applied already)" > "$FLAG_FILE"
|
|
|
|
echo -e "Use ${RED}'sudo reboot -h 0'${NOCOLOR} to successfully apply the theme, if logging out manually ${YELLOW}doesn't${NOCOLOR} work!"
|
|
progress_bar 2.5
|
|
|
|
echo ""
|
|
echo -n "Do you want to reboot now? (y/n): "
|
|
read -r answer
|
|
if [ -z "$answer" ] || [ "$answer" = "y" ] || [ "$answer" = "Y" ]; then
|
|
echo "Rebooting! ..."
|
|
sudo shutdown -r now
|
|
else
|
|
echo "Make sure to log out/reboot later!"
|
|
fi
|