Hyprland-dotfiles/.install/displaymanager.sh

70 lines
3.0 KiB
Bash
Raw Normal View History

2023-11-10 16:12:15 -05:00
# ------------------------------------------------------
# Disable display manager
# ------------------------------------------------------
disman=0
2023-11-17 07:48:02 -05:00
echo -e "${GREEN}"
2023-12-21 15:57:44 -05:00
figlet "Display Manager"
2023-11-17 07:48:02 -05:00
echo -e "${NONE}"
2023-12-20 05:46:07 -05:00
if [[ $profile == *"Hyprland"* ]]; then
echo "IMPORTANT: Starting Hyprland works from tty (terminal) with command Hyprland (recommended)"
echo "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 "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."
2023-11-10 16:12:15 -05:00
echo ""
2023-12-20 05:46:07 -05:00
fi
if [[ $profile == *"Qtile"* ]]; 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
2023-12-20 14:55:30 -05:00
echo "Qtile Wayland Session removed."
2023-11-10 16:12:15 -05:00
fi
2023-12-20 05:46:07 -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."
echo "If you install the aliases with the included .bashrc, you can start Qtile with the command Qtile."
echo ""
fi
2023-11-21 15:19:51 -05:00
2023-12-21 11:27:45 -05:00
if gum confirm "Do you want to enable/update to sddm-git?" ;then
2023-12-21 11:22:43 -05:00
# Try to force the installation of sddm-git
2023-12-21 11:25:21 -05:00
echo "Install sddm-git"
yay -S --noconfirm sddm-git --ask 4
2023-12-20 05:46:07 -05:00
if [ -f /etc/systemd/system/display-manager.service ]; then
sudo rm /etc/systemd/system/display-manager.service
fi
sudo systemctl enable sddm.service
2023-12-20 03:27:39 -05:00
2023-12-20 05:46:07 -05:00
if [ ! -d /etc/sddm.conf.d/ ]; then
sudo mkdir /etc/sddm.conf.d
echo "Folder /etc/sddm.conf.d created."
fi
2023-12-20 03:27:39 -05:00
2023-12-20 05:46:07 -05:00
sudo cp sddm/sddm.conf /etc/sddm.conf.d/
echo "File /etc/sddm.conf.d/sddm.conf updated."
2023-12-20 03:27:39 -05:00
2023-12-20 05:46:07 -05:00
if [ -f /usr/share/sddm/themes/sugar-candy/theme.conf ]; then
2023-12-21 12:30:37 -05:00
# Cache file for holding the current wallpaper
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/"
2023-12-20 05:46:07 -05:00
sudo cp sddm/theme.conf /usr/share/sddm/themes/sugar-candy/
2023-12-21 12:30:37 -05:00
sudo sed -i 's/CURRENTWALLPAPER/'"current_wallpaper.jpg"'/' /usr/share/sddm/themes/sugar-candy/theme.conf
2023-12-20 05:46:07 -05:00
echo "File theme.conf updated in /usr/share/sddm/themes/sugar-candy/"
2023-12-21 12:30:37 -05:00
2023-12-20 05:46:07 -05:00
fi
elif [ $? -eq 130 ]; then
exit 130
else
if [ -f /etc/systemd/system/display-manager.service ]; then
if gum confirm "Do you want to deactivate the current display manager?" ;then
2023-12-20 03:27:39 -05:00
sudo rm /etc/systemd/system/display-manager.service
2023-12-20 05:46:07 -05:00
echo "Current display manager deactivated."
disman=1
2023-12-20 03:27:39 -05:00
fi
2023-11-21 15:19:51 -05:00
fi
2023-11-10 16:12:15 -05:00
fi
2023-12-20 05:46:07 -05:00
echo ""