2023-11-10 16:12:15 -05:00
# ------------------------------------------------------
# Disable display manager
# ------------------------------------------------------
disman = 0
2023-12-20 03:27:39 -05:00
profile = "Hyprland"
2023-11-10 16:12:15 -05:00
if [ -f /etc/systemd/system/display-manager.service ] ; then
2023-11-17 07:48:02 -05:00
echo -e " ${ GREEN } "
2023-11-10 16:12:15 -05:00
cat <<"EOF"
2023-11-21 15:19:51 -05:00
____ _ _ __ __
| _ \( _) ___ _ __ | | __ _ _ _ | \/ | __ _ _ __ __ _ __ _ ___ _ __
| | | | / __| '_ \| |/ _` | | | | | |\/| |/ _` | ' _ \ / _` | / _` | / _ \ ' __|
| | _| | \_ _ \ | _) | | ( _| | | _| | | | | | ( _| | | | | ( _| | ( _| | __/ |
| ____/| _| ___/ .__/| _| \_ _,_| \_ _, | | _| | _| \_ _,_| _| | _| \_ _,_| \_ _, | \_ __| _|
| _| | ___/ | ___/
2023-11-10 16:12:15 -05:00
EOF
2023-11-17 07:48:02 -05:00
echo -e " ${ NONE } "
2023-12-20 03:27:39 -05:00
echo "An active display manager has been detected."
2023-11-10 16:12:15 -05:00
echo ""
2023-11-22 06:24:40 -05:00
if [ [ $profile = = *"Hyprland" * ] ] ; then
2023-12-20 03:27:39 -05:00
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)."
2023-11-23 02:09:40 -05:00
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."
2023-11-23 10:21:44 -05:00
echo ""
2023-11-10 16:12:15 -05:00
fi
2023-11-22 06:24:40 -05:00
if [ [ $profile = = *"Qtile" * ] ] ; then
2023-12-20 05:05:15 -05:00
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
fi
2023-11-10 16:12:15 -05:00
echo "PLEASE NOTE: Qtile works with Display Managers."
echo "But if you want to use the tty based (terminal) login instead, you can disable the display manager now."
2023-12-20 05:05:15 -05:00
echo "If you install the aliases with the included .bashrc, you can start Qtile with the command Qtile."
2023-11-23 10:21:44 -05:00
echo ""
2023-11-10 16:12:15 -05:00
fi
2023-11-21 15:19:51 -05:00
2023-12-20 03:27:39 -05:00
if gum confirm "Do you want to enable/update to sddm or disable the display manager?" --affirmative "Enable" --negative "Disable" ; then
2023-11-21 15:19:51 -05:00
if [ -f /etc/systemd/system/display-manager.service ] ; then
sudo rm /etc/systemd/system/display-manager.service
fi
2023-12-20 03:27:39 -05:00
sudo systemctl enable sddm.service
if [ ! -d /etc/sddm.conf.d/ ] ; then
sudo mkdir /etc/sddm.conf.d
echo "Folder /etc/sddm.conf.d created."
fi
sudo cp sddm/sddm.conf /etc/sddm.conf.d/
echo "File /etc/sddm.conf.d/sddm.conf updated."
if [ -f /usr/share/sddm/themes/sugar-candy/theme.conf ] ; then
if [ -f ~/.cache/current_wallpaper.jpg ] ; then
sudo cp ~/.cache/current_wallpaper.jpg /usr/share/sddm/themes/sugar-candy/Backgrounds/current_wallpaper.jpg
echo "Current wallpaper copied into /usr/share/sddm/themes/sugar-candy/Backgrounds/"
else
sudo cp wallpapers/default.jpg /usr/share/sddm/themes/sugar-candy/Backgrounds/current_wallpaper.jpg
echo "Default wallpaper copied into /usr/share/sddm/themes/sugar-candy/Backgrounds/"
fi
sudo cp sddm/theme.conf /usr/share/sddm/themes/sugar-candy/
echo "File theme.conf updated in /usr/share/sddm/themes/sugar-candy/"
fi
2023-11-21 15:19:51 -05:00
elif [ $? -eq 130 ] ; then
exit 130
else
2023-12-20 03:27:39 -05:00
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
2023-11-21 15:19:51 -05:00
fi
2023-11-10 16:12:15 -05:00
echo ""
else
disman = 1
fi