From 3755f62c5fb44e073f7055a81e120f28f048bf69 Mon Sep 17 00:00:00 2001 From: RealStickman Date: Mon, 8 Mar 2021 08:30:26 +0100 Subject: [PATCH] Selection of theme --- arch-config/scripts/arch-config.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/arch-config/scripts/arch-config.sh b/arch-config/scripts/arch-config.sh index db305d27..0672d841 100755 --- a/arch-config/scripts/arch-config.sh +++ b/arch-config/scripts/arch-config.sh @@ -4,6 +4,26 @@ set -euo pipefail #ANY CHANGES TO THE INSTALLATION PROCEDURE SHOULD BE MADE HERE +# function to select theme +function func_seltheme { + cmd=(dialog --separate-output --checklist "Select theme (Only select one)" 22 76 16) + options=(1 "Nyarch" off # any option can be set to default to "on" + 2 "Spaceengine Pink" off) + choices=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty) + clear + for choice in $choices + do + case $choice in + 1) + echo "nyarch" >> "$HOME/.seltheme" + ;; + 2) + echo "space-pink" >> "$HOME/.seltheme" + ;; + esac + done +} + # check if user is root if [ "$EUID" -ne 0 ]; then sudo -l > /dev/null @@ -24,6 +44,11 @@ if ! cmp --silent "$HOME/scripts/arch-config.sh" "$HOME/config/scripts/arch-conf rm "$HOME/scripts/arch-config.sh" && cp "$HOME/config/scripts/arch-config.sh" "$HOME/scripts/" && bash ~/scripts/arch-config.sh fi +# if no seltheme file exists, ask to select a theme +if [[ ! -f "$HOME/.seltheme" ]]; then + func_seltheme +fi + #delete previous backups echo Removing old backup rm -rf ~/old_dat