mirror of
https://github.com/Snigdha-OS/snigdhaos-system-installation.git
synced 2025-09-21 13:54:56 +02:00
🐞 fix(cases): simplified encapsulation and cases
This commit is contained in:
@@ -8,46 +8,31 @@ echo
|
|||||||
echo "--->> Start snigdhaos-fixes <<---"
|
echo "--->> Start snigdhaos-fixes <<---"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
|
# Get the current desktop environment
|
||||||
desktop=$(ls /usr/share/xsessions/)
|
desktop=$(ls /usr/share/xsessions/)
|
||||||
echo
|
|
||||||
# shellcheck disable=SC2086
|
|
||||||
echo "Your Current Desktop: "$desktop
|
|
||||||
echo
|
|
||||||
|
|
||||||
# Let's make some cases
|
# Define a function to install and enable SDDM
|
||||||
|
install_sddm() {
|
||||||
|
echo "INSTALLED: LightDM/GDM [STATUS: ACTIVE]"
|
||||||
|
pacman -S sddm --noconfirm --needed
|
||||||
|
systemctl enable sddm.service -f
|
||||||
|
}
|
||||||
|
|
||||||
|
# Check for specific desktop environments and install SDDM if necessary
|
||||||
case $desktop in
|
case $desktop in
|
||||||
ukui.desktop)
|
ukui.desktop|deepin.desktop)
|
||||||
echo "Found : Lightm [STATUS: ACTIVE]"
|
echo "Found : Lightm [STATUS: ACTIVE]"
|
||||||
pacman -S sddm --noconfirm --needed
|
install_sddm
|
||||||
systemctl enable sddm.service -f
|
|
||||||
;;
|
|
||||||
deepin.desktop)
|
|
||||||
echo "Found : Lightm [STATUS: ACTIVE]"
|
|
||||||
pacman -S sddm --noconfirm --needed
|
|
||||||
systemctl enable sddm.service -f
|
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
# Check for other desktop environments
|
||||||
|
if [ -f /usr/bin/gnome-session ] || [ -f /usr/bin/startdde ] || [ -f /usr/bin/ukui-session ]; then
|
||||||
|
install_sddm
|
||||||
|
else
|
||||||
echo "Nothing To Do!!!"
|
echo "Nothing To Do!!!"
|
||||||
|
fi
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if [ -f /usr/bin/gnome-session ]; then
|
|
||||||
echo "INSTALLED: GDM [STATUS: ACTIVE]"
|
|
||||||
pacman -S sddm --noconfirm --needed
|
|
||||||
systemctl enable sddm.service -f
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f /usr/bin/startdde ]; then
|
|
||||||
echo "INSTALLED: LightDM [STATUS: ACTIVE]"
|
|
||||||
pacman -S sddm --noconfirm --needed
|
|
||||||
systemctl enable sddm.service -f
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f /usr/bin/ukui-session ]; then
|
|
||||||
echo "INSTALLED: LightDM [STATUS: ACTIVE]"
|
|
||||||
pacman -S sddm --noconfirm --needed
|
|
||||||
systemctl enable sddm.service -f
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "--->> End snigdhaos-fixes <<---"
|
echo "--->> End snigdhaos-fixes <<---"
|
||||||
echo
|
echo
|
Reference in New Issue
Block a user