updated secondary check for disable other login managers

This commit is contained in:
JaKooLit
2025-02-09 09:40:32 +09:00
parent 9695a4c75b
commit d09e2dfd09

View File

@@ -9,6 +9,15 @@ sddm=(
sddm sddm
) )
# login managers to attempt to disable
login=(
lightdm
gdm3
gdm
lxdm
lxdm-gtk3
)
## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ##
# Determine the directory where the script is located # Determine the directory where the script is located
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
@@ -29,16 +38,26 @@ printf "${NOTE} Installing sddm and dependencies........\n"
install_package "$package" "$LOG" install_package "$package" "$LOG"
done done
printf "\n%.0s" {1..1}
# Check if other login managers installed and disabling its service before enabling sddm # Check if other login managers installed and disabling its service before enabling sddm
for login_manager in lightdm gdm3 gdm lxdm lxdm-gtk3; do for login_manager in "${login[@]}"; do
if pacman -Qs "$login_manager" > /dev/null; then if pacman -Qs "$login_manager" > /dev/null 2>&1; then
echo "disabling $login_manager..."
sudo systemctl disable "$login_manager.service" >> "$LOG" 2>&1 sudo systemctl disable "$login_manager.service" >> "$LOG" 2>&1
echo "$login_manager disabled." echo "$login_manager disabled." >> "$LOG" 2>&1
fi fi
done done
printf " Activating sddm service........\n" # Double check with systemctl
for manager in "${login[@]}"; do
if systemctl is-active --quiet "$manager" > /dev/null 2>&1; then
echo "$manager is active, disabling it..." >> "$LOG" 2>&1
sudo systemctl disable "$manager" --now >> "$LOG" 2>&1
fi
done
printf "\n%.0s" {1..1}
printf "${INFO} Activating sddm service........\n"
sudo systemctl enable sddm sudo systemctl enable sddm
wayland_sessions_dir=/usr/share/wayland-sessions wayland_sessions_dir=/usr/share/wayland-sessions