Skip to content

Commit 8377024

Browse files
committed
Change SDDM install script re Theme
1 parent 739ef38 commit 8377024

File tree

1 file changed

+39
-5
lines changed

1 file changed

+39
-5
lines changed

install-scripts/sddm.sh

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,47 @@ sudo cp assets/hyprland.desktop "$wayland_sessions_dir/" 2>&1 | tee -a "$LOG"
8484

8585
clear
8686

87-
# SDDM-themes
87+
# SDDM-themes
88+
valid_input=false
89+
while [ "$valid_input" != true ]; do
8890
read -n 1 -r -p "${CAT} OPTIONAL - Would you like to install SDDM themes? (y/n)" install_sddm_theme
8991
if [[ $install_sddm_theme =~ ^[Yy]$ ]]; then
90-
printf "\n%s - Installing Tokyo SDDM Theme\n" "${NOTE}"
91-
git clone https://github.com/rototrash/tokyo-night-sddm.git 2>&1 | tee -a "$LOG"
92-
sudo mv tokyo-night-sddm /usr/share/sddm/themes/
93-
echo -e "[Theme]\nCurrent=tokyo-night-sddm" | sudo tee -a "$sddm_conf_dir/10-theme.conf" 2>&1 | tee -a "$LOG"
92+
printf "\n%s - Installing Simple SDDM Theme\n" "${NOTE}"
93+
94+
# Check if /usr/share/sddm/themes/simple-sddm exists and remove if it does
95+
if [ -d "/usr/share/sddm/themes/simple-sddm" ]; then
96+
sudo rm -rf "/usr/share/sddm/themes/simple-sddm"
97+
echo -e "\e[1A\e[K${OK} - Removed existing 'simple-sddm' directory." 2>&1 | tee -a "$LOG"
98+
fi
99+
100+
# Check if simple-sddm directory exists in the current directory and remove if it does
101+
if [ -d "simple-sddm" ]; then
102+
rm -rf "simple-sddm"
103+
echo -e "\e[1A\e[K${OK} - Removed existing 'simple-sddm' directory from the current location." 2>&1 | tee -a "$LOG"
104+
fi
105+
106+
if git clone https://github.com/JaKooLit/simple-sddm.git 2>&1 | tee -a "$LOG"; then
107+
while [ ! -d "simple-sddm" ]; do
108+
sleep 1
109+
done
110+
111+
if [ ! -d "/usr/share/sddm/themes" ]; then
112+
sudo mkdir -p /usr/share/sddm/themes
113+
echo -e "\e[1A\e[K${OK} - Directory '/usr/share/sddm/themes' created." 2>&1 | tee -a "$LOG"
114+
fi
115+
116+
sudo mv simple-sddm /usr/share/sddm/themes/
117+
echo -e "[Theme]\nCurrent=simple-sddm" | sudo tee -a "$sddm_conf_dir/10-theme.conf" &>> "$LOG"
118+
else
119+
echo -e "\e[1A\e[K${ERROR} - Failed to clone the theme repository. Please check your internet connection or repository availability." | tee -a "$LOG" >&2
120+
fi
121+
valid_input=true
122+
elif [[ $install_sddm_theme =~ ^[Nn]$ ]]; then
123+
printf "\n%s - No SDDM themes will be installed.\n" "${NOTE}" 2>&1 | tee -a "$LOG"
124+
valid_input=true
125+
else
126+
printf "\n%s - Invalid input. Please enter 'y' for Yes or 'n' for No.\n" "${ERROR}" 2>&1 | tee -a "$LOG"
94127
fi
128+
done
95129

96130
clear

0 commit comments

Comments
 (0)