From aed645c7e2354e90ab75eed6416f9d5497cfcd59 Mon Sep 17 00:00:00 2001 From: Eshan Roy <148610067+eshanized@users.noreply.github.com> Date: Thu, 1 Aug 2024 04:13:56 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix(cases):=20simplified=20encap?= =?UTF-8?q?sulation=20and=20cases?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- usr/local/bin/snigdhaos-fixes | 53 +++++++++++++---------------------- 1 file changed, 19 insertions(+), 34 deletions(-) diff --git a/usr/local/bin/snigdhaos-fixes b/usr/local/bin/snigdhaos-fixes index f783655..7faf23f 100755 --- a/usr/local/bin/snigdhaos-fixes +++ b/usr/local/bin/snigdhaos-fixes @@ -8,46 +8,31 @@ echo echo "--->> Start snigdhaos-fixes <<---" echo +# Get the current desktop environment 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 - ukui.desktop) + ukui.desktop|deepin.desktop) echo "Found : Lightm [STATUS: ACTIVE]" - pacman -S sddm --noconfirm --needed - systemctl enable sddm.service -f - ;; - deepin.desktop) - echo "Found : Lightm [STATUS: ACTIVE]" - pacman -S sddm --noconfirm --needed - systemctl enable sddm.service -f - ;; - *) - echo "Nothing To Do!!!" + install_sddm + ;; + *) + # 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!!!" + fi 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 "--->> End snigdhaos-fixes <<---" echo \ No newline at end of file