Add SDDM toogle

This commit is contained in:
Stephan Raabe 2023-12-20 11:46:07 +01:00
parent db7afcc599
commit 16117c1502
8 changed files with 106 additions and 82 deletions

View File

@ -3,7 +3,6 @@
# ------------------------------------------------------ # ------------------------------------------------------
disman=0 disman=0
profile="Hyprland" profile="Hyprland"
if [ -f /etc/systemd/system/display-manager.service ]; then
echo -e "${GREEN}" echo -e "${GREEN}"
cat <<"EOF" cat <<"EOF"
____ _ _ __ __ ____ _ _ __ __
@ -15,15 +14,16 @@ cat <<"EOF"
EOF EOF
echo -e "${NONE}" echo -e "${NONE}"
echo "An active display manager has been detected." if [[ $profile == *"Hyprland"* ]]; then
echo "" echo "IMPORTANT: Starting Hyprland works from tty (terminal) with command Hyprland (recommended)"
if [[ $profile == *"Hyprland"* ]]; then echo "or with the display manager SDDM (> 0.20.0 already installed) or the latest git version (yay -S sddm-git)."
echo "IMPORTANT: Starting Hyprland works from tty (terminal) with command Hyprland or with the display manager SDDM (> 0.20.0 already installed or the latest git version (yay -S sddm-git)."
echo "Please check: https://wiki.hyprland.org/hyprland-wiki/pages/Getting-Started/Master-Tutorial/#launching-hyprland" echo "Please check: https://wiki.hyprland.org/hyprland-wiki/pages/Getting-Started/Master-Tutorial/#launching-hyprland"
echo "Login with other display managers could fail and could have negative side effects on some devices." echo "Login with other display managers could fail and could have negative side effects on some devices."
echo "If you have issues with SDDM or other display managers, you can deactivate the display manager"
echo "at any time with the Hyprland settings script from Waybar or with SUPER+CTRL-S."
echo "" echo ""
fi fi
if [[ $profile == *"Qtile"* ]]; then if [[ $profile == *"Qtile"* ]]; then
if [ -f /usr/share/wayland-sessions/qtile-wayland.desktop ]; then if [ -f /usr/share/wayland-sessions/qtile-wayland.desktop ]; then
sudo mv /usr/share/wayland-sessions/qtile-wayland.desktop /usr/share/wayland-sessions/qtile-wayland.bak sudo mv /usr/share/wayland-sessions/qtile-wayland.desktop /usr/share/wayland-sessions/qtile-wayland.bak
fi fi
@ -31,9 +31,9 @@ echo -e "${NONE}"
echo "But if you want to use the tty based (terminal) login instead, you can disable the display manager now." echo "But if you want to use the tty based (terminal) login instead, you can disable the display manager now."
echo "If you install the aliases with the included .bashrc, you can start Qtile with the command Qtile." echo "If you install the aliases with the included .bashrc, you can start Qtile with the command Qtile."
echo "" echo ""
fi fi
if gum confirm "Do you want to enable/update to sddm or disable the display manager?" --affirmative "Enable" --negative "Disable" ;then if gum confirm "Do you want to enable/update to sddm?" ;then
if [ -f /etc/systemd/system/display-manager.service ]; then if [ -f /etc/systemd/system/display-manager.service ]; then
sudo rm /etc/systemd/system/display-manager.service sudo rm /etc/systemd/system/display-manager.service
fi fi
@ -59,16 +59,15 @@ echo -e "${NONE}"
sudo cp sddm/theme.conf /usr/share/sddm/themes/sugar-candy/ sudo cp sddm/theme.conf /usr/share/sddm/themes/sugar-candy/
echo "File theme.conf updated in /usr/share/sddm/themes/sugar-candy/" echo "File theme.conf updated in /usr/share/sddm/themes/sugar-candy/"
fi fi
elif [ $? -eq 130 ]; then elif [ $? -eq 130 ]; then
exit 130 exit 130
else
if [ -f /etc/systemd/system/display-manager.service ]; then
sudo rm /etc/systemd/system/display-manager.service
echo "Current display manager removed."
fi
disman=1
fi
echo ""
else else
if [ -f /etc/systemd/system/display-manager.service ]; then
if gum confirm "Do you want to deactivate the current display manager?" ;then
sudo rm /etc/systemd/system/display-manager.service
echo "Current display manager deactivated."
disman=1 disman=1
fi
fi
fi fi
echo ""

View File

@ -0,0 +1,4 @@
name="Background"
desxription="Update the background wallpaper of sddm to the current wallpaper."
order=50
author="Stephan Raabe ML4W"

View File

@ -0,0 +1,23 @@
#!/bin/bash
_getHeader "$name" "$author"
if gum confirm "Do you want to update the SDDM background with the current wallpaper?" ;then
if [ ! -d /etc/sddm.conf.d/ ]; then
sudo mkdir /etc/sddm.conf.d
echo "Folder /etc/sddm.conf.d created."
fi
sudo cp ~/dotfiles/sddm/sddm.conf /etc/sddm.conf.d/
echo "File /etc/sddm.conf.d/sddm.conf updated."
sudo cp ~/.cache/current_wallpaper.jpg /usr/share/sddm/themes/sugar-candy/Backgrounds/
echo "Current wallpaper copied into /usr/share/sddm/themes/sugar-candy/Backgrounds/"
sudo cp ~/dotfiles/sddm/theme.conf /usr/share/sddm/themes/sugar-candy/
echo "File theme.conf updated in /usr/share/sddm/themes/sugar-candy/"
echo ""
echo "SDDM background successfully updated!"
sleep 2
fi
_goBack

View File

@ -1,4 +1,2 @@
name="SDDM" name="SDDM"
desxription="Update the background wallpaper of sddm to the current wallpaper." order=30
order=50
author="Stephan Raabe ML4W"

View File

@ -0,0 +1,4 @@
name="Enable Disable"
desxription="Update the background wallpaper of sddm to the current wallpaper."
order=50
author="Stephan Raabe ML4W"

View File

@ -0,0 +1,18 @@
#!/bin/bash
_getHeader "$name" "$author"
if [ -f /etc/systemd/system/display-manager.service ]; then
if gum confirm "Do you want to disable the current display manager?" ;then
sudo rm /etc/systemd/system/display-manager.service
echo "Current display manager removed. Please reboot your system."
sleep 2
fi
else
if gum confirm "Do you want to enable SDDM as your display manager?" ;then
sudo systemctl enable sddm.service
echo "Display manager SDDM has been enabled. Please reboot your system."
sleep 2
fi
fi
_goBack

View File

@ -1,23 +1,2 @@
#!/bin/bash #!/bin/bash
_getHeader "$name" "$author" _getHeader "$name"
if gum confirm "Do you want to update the SDDM background with the current wallpaper?" ;then
if [ ! -d /etc/sddm.conf.d/ ]; then
sudo mkdir /etc/sddm.conf.d
echo "Folder /etc/sddm.conf.d created."
fi
sudo cp ~/dotfiles/sddm/sddm.conf /etc/sddm.conf.d/
echo "File /etc/sddm.conf.d/sddm.conf updated."
sudo cp ~/.cache/current_wallpaper.jpg /usr/share/sddm/themes/sugar-candy/Backgrounds/
echo "Current wallpaper copied into /usr/share/sddm/themes/sugar-candy/Backgrounds/"
sudo cp ~/dotfiles/sddm/theme.conf /usr/share/sddm/themes/sugar-candy/
echo "File theme.conf updated in /usr/share/sddm/themes/sugar-candy/"
echo ""
echo "SDDM background successfully updated!"
sleep 2
fi
_goBack

View File

@ -1,3 +1,2 @@
name="System" name="System"
order=30 order=30
author="Stephan Raabe ML4W"