mirror of
https://github.com/stornic56/debianito-post-install.git
synced 2026-09-14 06:02:35 +00:00
dual-gpu fix & lspci cache
- Replaced the restrictive Broadcom firmware installation flow with a persistent, step-by-step process in modules/firmware.sh. Now installs dkms, wireless-tools, and linux-headers-amd64 separately, then applies blacklist configuration, updates initramfs, and loads conflicting modules properly. - Fixed conky package name across system.sh and bullseye/extras.sh. Changed from "conky" to "conky-all" with corresponding state variable updates for correct installation via apt. - Corrected broken GRUB sed command in modules/gpu.sh for AMD GCN support. Added grep guard to prevent duplicate parameter insertion and fixed regex pattern for proper cmdline modification. - Added whiptail pre-flight check in debianito.sh. Auto-installs required TUI dependencies if missing before the main menu, preventing runtime failures. - Fixed home directory path resolution bug in modules/sudo_config.sh. Replaced eval echo "~$USER" with getent passwd approach for reliable user home detection across SUDO_USER contexts. - Implemented global lspci output caching across 18+ locations. Single cache population via _init_lspci_cache() before detect_gpu, all subsequent reads use LSPCI_OUTPUT variable to eliminate redundant hardware polling calls. - Added apt update deduplication helper in modules/utils.sh. _ensure_apt_updated() with APT_UPDATED flag bypasses redundant package list refreshes across extras/, gaming/, firmware/, and desktop_display/ modules while preserving transactional rollback paths in repos.sh. - Fixed STATE_REFRESHED logic in debianito.sh main_menu case statement. Added STATE_REFRESHED=true to branches 3, 5, 7, 9, 11, 12, and 13 that mutate system state, ensuring refresh_system_state() triggers correctly after configuration changes. - Removed dead REPOS_CONFIGURED variable from debianito.sh and modules/repos.sh. Variable was written but never read, eliminated to clean up global namespace without affecting repository functionality.
This commit is contained in:
+166
-166
@@ -11,9 +11,9 @@ manage_desktop_display() {
|
||||
[ -z "$choice" ] && break
|
||||
clear
|
||||
case "$choice" in
|
||||
1) desktop_environment_menu ;;
|
||||
2) display_manager_menu ;;
|
||||
3) break ;;
|
||||
1) desktop_environment_menu ;;
|
||||
2) display_manager_menu ;;
|
||||
3) break ;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
@@ -33,9 +33,9 @@ desktop_environment_menu() {
|
||||
[ -z "$choice" ] && break
|
||||
clear
|
||||
case "$choice" in
|
||||
1) xfce_menu ;;
|
||||
2) lxde_menu ;;
|
||||
3) break ;;
|
||||
1) xfce_menu ;;
|
||||
2) lxde_menu ;;
|
||||
3) break ;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
@@ -49,8 +49,8 @@ lxde_menu() {
|
||||
[ -z "$choice" ] && return 0
|
||||
clear
|
||||
case "$(echo "$choice" | tr -d '"')" in
|
||||
1) _install_lxde_full ;;
|
||||
2) _install_lxde_core ;;
|
||||
1) _install_lxde_full ;;
|
||||
2) _install_lxde_core ;;
|
||||
esac
|
||||
}
|
||||
|
||||
@@ -87,11 +87,11 @@ xfce_menu() {
|
||||
[ -z "$choice" ] && break
|
||||
clear
|
||||
case "$choice" in
|
||||
1) _install_xfce_full ;;
|
||||
2) _install_xfce_minimal ;;
|
||||
3) _install_xfce_wayland ;;
|
||||
4) _install_xfce_custom ;;
|
||||
5) break ;;
|
||||
1) _install_xfce_full ;;
|
||||
2) _install_xfce_minimal ;;
|
||||
3) _install_xfce_wayland ;;
|
||||
4) _install_xfce_custom ;;
|
||||
5) break ;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
@@ -188,26 +188,26 @@ display_manager_menu() {
|
||||
[ -z "$choice" ] && break
|
||||
clear
|
||||
case "$choice" in
|
||||
1) lightdm_config_menu ;;
|
||||
2) configure_gdm3 ;;
|
||||
3) configure_sddm ;;
|
||||
4)
|
||||
if [ "$DEBIAN_VERSION" = "12" ] || [ "$DEBIAN_VERSION" = "13" ]; then
|
||||
configure_greetd
|
||||
else
|
||||
break
|
||||
fi
|
||||
;;
|
||||
5) break ;;
|
||||
1) lightdm_config_menu ;;
|
||||
2) configure_gdm3 ;;
|
||||
3) configure_sddm ;;
|
||||
4)
|
||||
if [ "$DEBIAN_VERSION" = "12" ] || [ "$DEBIAN_VERSION" = "13" ]; then
|
||||
configure_greetd
|
||||
else
|
||||
break
|
||||
fi
|
||||
;;
|
||||
5) break ;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
lightdm_config_menu() {
|
||||
local -a items=()
|
||||
items+=("install_lightdm" "Install LightDM & GTK Greeter" "$(_state lightdm)")
|
||||
items+=("enable_userlist" "Enable user list at login screen" "OFF")
|
||||
items+=("enable_autologin" "Enable autologin for current user" "OFF")
|
||||
items+=("install_lightdm" "Install LightDM & GTK Greeter" "$(_state lightdm)")
|
||||
items+=("enable_userlist" "Enable user list at login screen" "OFF")
|
||||
items+=("enable_autologin" "Enable autologin for current user" "OFF")
|
||||
local choices
|
||||
choices=$(_checklist "LightDM Configuration" \
|
||||
"Select options to apply:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \
|
||||
@@ -221,34 +221,34 @@ lightdm_config_menu() {
|
||||
cleaned=$(echo "$choices" | tr -d '"')
|
||||
for item in $cleaned; do
|
||||
case $item in
|
||||
install_lightdm)
|
||||
if ! is_installed lightdm || ! is_installed lightdm-gtk-greeter-settings; then
|
||||
echo "lightdm shared/default-x-display-manager select lightdm" | sudo debconf-set-selections
|
||||
_run_cmd "LightDM" "sudo apt install -y lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings" "Installing LightDM & GTK Greeter..."
|
||||
else
|
||||
echo -e "${GREEN}[LightDM] LightDM and GTK Greeter settings are already installed, skipping...${NC}"
|
||||
fi
|
||||
;;
|
||||
enable_userlist)
|
||||
local conf="/etc/lightdm/lightdm.conf.d/50-debianito-userlist.conf"
|
||||
sudo mkdir -p "$(dirname "$conf")"
|
||||
if echo "[Seat:*]
|
||||
greeter-hide-users=false" | sudo tee "$conf" > /dev/null; then
|
||||
echo -e "${GREEN}User list enabled in LightDM.${NC}"
|
||||
else
|
||||
echo -e "${RED}Failed to write configuration.${NC}"
|
||||
fi
|
||||
;;
|
||||
enable_autologin)
|
||||
local dm_conf="/etc/lightdm/lightdm.conf"
|
||||
local lightdm_user="${SUDO_USER:-$USER}"
|
||||
sudo sed -i 's/^#[[:space:]]*autologin-user[[:space:]=].*/autologin-user='"$lightdm_user"'/' "$dm_conf"
|
||||
sudo sed -i 's/^#[[:space:]]*autologin-user-timeout[[:space:]=].*/autologin-user-timeout=0/' "$dm_conf"
|
||||
echo -e "${GREEN}Autologin enabled for user: ${lightdm_user}${NC}"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
_pause
|
||||
install_lightdm)
|
||||
if ! is_installed lightdm || ! is_installed lightdm-gtk-greeter-settings; then
|
||||
echo "lightdm shared/default-x-display-manager select lightdm" | sudo debconf-set-selections
|
||||
_run_cmd "LightDM" "sudo apt install -y lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings" "Installing LightDM & GTK Greeter..."
|
||||
else
|
||||
echo -e "${GREEN}[LightDM] LightDM and GTK Greeter settings are already installed, skipping...${NC}"
|
||||
fi
|
||||
;;
|
||||
enable_userlist)
|
||||
local conf="/etc/lightdm/lightdm.conf.d/50-debianito-userlist.conf"
|
||||
sudo mkdir -p "$(dirname "$conf")"
|
||||
if echo "[Seat:*]
|
||||
greeter-hide-users=false" | sudo tee "$conf" >/dev/null; then
|
||||
echo -e "${GREEN}User list enabled in LightDM.${NC}"
|
||||
else
|
||||
echo -e "${RED}Failed to write configuration.${NC}"
|
||||
fi
|
||||
;;
|
||||
enable_autologin)
|
||||
local dm_conf="/etc/lightdm/lightdm.conf"
|
||||
local lightdm_user="${SUDO_USER:-$USER}"
|
||||
sudo sed -i 's/^#[[:space:]]*autologin-user[[:space:]=].*/autologin-user='"$lightdm_user"'/' "$dm_conf"
|
||||
sudo sed -i 's/^#[[:space:]]*autologin-user-timeout[[:space:]=].*/autologin-user-timeout=0/' "$dm_conf"
|
||||
echo -e "${GREEN}Autologin enabled for user: ${lightdm_user}${NC}"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
_pause
|
||||
}
|
||||
|
||||
configure_greetd() {
|
||||
@@ -272,47 +272,47 @@ configure_greetd() {
|
||||
[ -z "$choice" ] && return
|
||||
clear
|
||||
case "$choice" in
|
||||
1)
|
||||
1)
|
||||
echo "greetd shared/default-x-display-manager select greetd" | sudo debconf-set-selections
|
||||
_run_cmd "greetd" "sudo apt install -y greetd" "Installing greetd..."
|
||||
_msg "greetd" "Warning: greetd was installed but NOT configured.\n\nYou must manually create /etc/greetd/config.toml\nto be able to log in.\n\nSee 'man greetd' and 'man 5 greetd-sessions'."
|
||||
;;
|
||||
2)
|
||||
if [ "$DEBIAN_VERSION" = "12" ]; then
|
||||
if [ "$(is_backports_enabled)" != true ]; then
|
||||
_write_deb822_backports "bookworm"
|
||||
_ensure_apt_updated
|
||||
fi
|
||||
_run_cmd "greetd" "sudo apt install -y -t bookworm-backports tuigreet greetd" "Installing greetd + tuigreet..."
|
||||
else
|
||||
_run_cmd "greetd" "sudo apt install -y greetd tuigreet" "Installing greetd + tuigreet..."
|
||||
fi
|
||||
_msg "greetd" "Warning: greetd was installed but NOT configured.\n\nYou must manually create /etc/greetd/config.toml\nto be able to log in.\n\nSee 'man greetd' and 'man 5 greetd-sessions'."
|
||||
;;
|
||||
3)
|
||||
if [ "$DEBIAN_VERSION" = "13" ]; then
|
||||
echo "greetd shared/default-x-display-manager select greetd" | sudo debconf-set-selections
|
||||
_run_cmd "greetd" "sudo apt install -y greetd" "Installing greetd..."
|
||||
_run_cmd "greetd" "sudo apt install -y greetd gtkgreet" "Installing greetd + gtkgreet..."
|
||||
_msg "greetd" "Warning: greetd was installed but NOT configured.\n\nYou must manually create /etc/greetd/config.toml\nto be able to log in.\n\nSee 'man greetd' and 'man 5 greetd-sessions'."
|
||||
;;
|
||||
2)
|
||||
if [ "$DEBIAN_VERSION" = "12" ]; then
|
||||
if [ "$(is_backports_enabled)" != true ]; then
|
||||
_write_deb822_backports "bookworm"
|
||||
sudo apt update -qq
|
||||
fi
|
||||
_run_cmd "greetd" "sudo apt install -y -t bookworm-backports tuigreet greetd" "Installing greetd + tuigreet..."
|
||||
else
|
||||
_run_cmd "greetd" "sudo apt install -y greetd tuigreet" "Installing greetd + tuigreet..."
|
||||
fi
|
||||
else
|
||||
return
|
||||
fi
|
||||
;;
|
||||
4)
|
||||
if [ "$DEBIAN_VERSION" = "13" ]; then
|
||||
echo "greetd shared/default-x-display-manager select greetd" | sudo debconf-set-selections
|
||||
_run_cmd "greetd" "sudo apt install -y greetd nwg-hello" "Installing greetd + nwg-hello..."
|
||||
_msg "greetd" "Warning: greetd was installed but NOT configured.\n\nYou must manually create /etc/greetd/config.toml\nto be able to log in.\n\nSee 'man greetd' and 'man 5 greetd-sessions'."
|
||||
;;
|
||||
3)
|
||||
if [ "$DEBIAN_VERSION" = "13" ]; then
|
||||
echo "greetd shared/default-x-display-manager select greetd" | sudo debconf-set-selections
|
||||
_run_cmd "greetd" "sudo apt install -y greetd gtkgreet" "Installing greetd + gtkgreet..."
|
||||
_msg "greetd" "Warning: greetd was installed but NOT configured.\n\nYou must manually create /etc/greetd/config.toml\nto be able to log in.\n\nSee 'man greetd' and 'man 5 greetd-sessions'."
|
||||
else
|
||||
return
|
||||
fi
|
||||
;;
|
||||
4)
|
||||
if [ "$DEBIAN_VERSION" = "13" ]; then
|
||||
echo "greetd shared/default-x-display-manager select greetd" | sudo debconf-set-selections
|
||||
_run_cmd "greetd" "sudo apt install -y greetd nwg-hello" "Installing greetd + nwg-hello..."
|
||||
_msg "greetd" "Warning: greetd was installed but NOT configured.\n\nYou must manually create /etc/greetd/config.toml\nto be able to log in.\n\nSee 'man greetd' and 'man 5 greetd-sessions'."
|
||||
fi
|
||||
;;
|
||||
5)
|
||||
if [ "$DEBIAN_VERSION" = "13" ]; then
|
||||
echo "greetd shared/default-x-display-manager select greetd" | sudo debconf-set-selections
|
||||
_run_cmd "greetd" "sudo apt install -y greetd wlgreet" "Installing greetd + wlgreet..."
|
||||
_msg "greetd" "Warning: greetd was installed but NOT configured.\n\nYou must manually create /etc/greetd/config.toml\nto be able to log in.\n\nSee 'man greetd' and 'man 5 greetd-sessions'."
|
||||
fi
|
||||
;;
|
||||
6) return ;;
|
||||
fi
|
||||
;;
|
||||
5)
|
||||
if [ "$DEBIAN_VERSION" = "13" ]; then
|
||||
echo "greetd shared/default-x-display-manager select greetd" | sudo debconf-set-selections
|
||||
_run_cmd "greetd" "sudo apt install -y greetd wlgreet" "Installing greetd + wlgreet..."
|
||||
_msg "greetd" "Warning: greetd was installed but NOT configured.\n\nYou must manually create /etc/greetd/config.toml\nto be able to log in.\n\nSee 'man greetd' and 'man 5 greetd-sessions'."
|
||||
fi
|
||||
;;
|
||||
6) return ;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
@@ -320,12 +320,12 @@ configure_greetd() {
|
||||
configure_gdm3() {
|
||||
while true; do
|
||||
local items_enabled=()
|
||||
items_enabled+=("install" "Install/Reinstall gdm3 (Set as default)" "$(_state gdm3)")
|
||||
items_enabled+=("userlist" "Hide user list (disable-user-list)" "OFF")
|
||||
items_enabled+=("autologin" "Configure Autologin" "OFF")
|
||||
items_enabled+=("install" "Install/Reinstall gdm3 (Set as default)" "$(_state gdm3)")
|
||||
items_enabled+=("userlist" "Hide user list (disable-user-list)" "OFF")
|
||||
items_enabled+=("autologin" "Configure Autologin" "OFF")
|
||||
if [ "$DEBIAN_VERSION" = "12" ] || [ "$DEBIAN_VERSION" = "13" ]; then
|
||||
if [ "$HAS_NVIDIA" = true ]; then
|
||||
items_enabled+=("wayland" "Force Enable Wayland on NVIDIA (Risk!)" "OFF")
|
||||
items_enabled+=("wayland" "Force Enable Wayland on NVIDIA (Risk!)" "OFF")
|
||||
fi
|
||||
fi
|
||||
local choice
|
||||
@@ -340,50 +340,50 @@ configure_gdm3() {
|
||||
cleaned=$(echo "$choice" | tr -d '"')
|
||||
for item in $cleaned; do
|
||||
case $item in
|
||||
install)
|
||||
echo "gdm3 shared/default-x-display-manager select gdm3" | sudo debconf-set-selections
|
||||
_run_cmd "GDM3" "sudo apt install -y gdm3" "Installing gdm3..."
|
||||
;;
|
||||
userlist)
|
||||
local greeter_conf="/etc/gdm3/greeter.dconf-defaults"
|
||||
if sudo grep -q '^disable-user-list=true' "$greeter_conf" 2>/dev/null; then
|
||||
sudo sed -i 's/^disable-user-list=true/# disable-user-list=true/' "$greeter_conf"
|
||||
echo -e "${GREEN}User list is now VISIBLE.${NC}"
|
||||
else
|
||||
sudo sed -i 's/^#[[:space:]]*disable-user-list=true/disable-user-list=true/' "$greeter_conf"
|
||||
echo -e "${GREEN}User list is now HIDDEN.${NC}"
|
||||
install)
|
||||
echo "gdm3 shared/default-x-display-manager select gdm3" | sudo debconf-set-selections
|
||||
_run_cmd "GDM3" "sudo apt install -y gdm3" "Installing gdm3..."
|
||||
;;
|
||||
userlist)
|
||||
local greeter_conf="/etc/gdm3/greeter.dconf-defaults"
|
||||
if sudo grep -q '^disable-user-list=true' "$greeter_conf" 2>/dev/null; then
|
||||
sudo sed -i 's/^disable-user-list=true/# disable-user-list=true/' "$greeter_conf"
|
||||
echo -e "${GREEN}User list is now VISIBLE.${NC}"
|
||||
else
|
||||
sudo sed -i 's/^#[[:space:]]*disable-user-list=true/disable-user-list=true/' "$greeter_conf"
|
||||
echo -e "${GREEN}User list is now HIDDEN.${NC}"
|
||||
fi
|
||||
sudo dpkg-reconfigure gdm3 >/dev/null 2>&1
|
||||
;;
|
||||
autologin)
|
||||
local daemon_conf="/etc/gdm3/daemon.conf"
|
||||
local username
|
||||
username=$(whiptail --title "GDM3 Autologin" \
|
||||
--inputbox "Enter username to autologin (leave empty to DISABLE autologin):" \
|
||||
10 60 "" 3>&1 1>&2 2>&3 || true)
|
||||
if [ -n "$username" ]; then
|
||||
sudo sed -i 's/^# *AutomaticLoginEnable[[:space:]=].*/AutomaticLoginEnable=true/' "$daemon_conf"
|
||||
sudo sed -i 's/^# *AutomaticLogin[[:space:]=].*/AutomaticLogin='"$username"'/' "$daemon_conf"
|
||||
echo -e "${GREEN}Autologin enabled for user: ${username}${NC}"
|
||||
else
|
||||
sudo sed -i 's/^AutomaticLoginEnable[[:space:]=].*/# AutomaticLoginEnable=false/' "$daemon_conf"
|
||||
sudo sed -i 's/^AutomaticLogin[[:space:]=].*/# AutomaticLogin=/' "$daemon_conf"
|
||||
echo -e "${GREEN}Autologin disabled.${NC}"
|
||||
fi
|
||||
;;
|
||||
wayland)
|
||||
local rules_link="/etc/udev/rules.d/61-gdm.rules"
|
||||
if [ -L "$rules_link" ] || [ -f "$rules_link" ]; then
|
||||
sudo rm -f "$rules_link"
|
||||
echo -e "${GREEN}Reverted. Wayland will be disabled by default on next reboot.${NC}"
|
||||
elif [ -f "/lib/udev/rules.d/61-gdm.rules" ]; then
|
||||
if _confirm "Wayland on NVIDIA" \
|
||||
"Force-enable Wayland on NVIDIA?\n\nRisk: This may break graphics or cause instability.\nProceed?"; then
|
||||
sudo ln -s /dev/null "$rules_link"
|
||||
echo -e "${GREEN}Wayland override created. Reboot required.${NC}"
|
||||
fi
|
||||
sudo dpkg-reconfigure gdm3 >/dev/null 2>&1
|
||||
;;
|
||||
autologin)
|
||||
local daemon_conf="/etc/gdm3/daemon.conf"
|
||||
local username
|
||||
username=$(whiptail --title "GDM3 Autologin" \
|
||||
--inputbox "Enter username to autologin (leave empty to DISABLE autologin):" \
|
||||
10 60 "" 3>&1 1>&2 2>&3 || true)
|
||||
if [ -n "$username" ]; then
|
||||
sudo sed -i 's/^# *AutomaticLoginEnable[[:space:]=].*/AutomaticLoginEnable=true/' "$daemon_conf"
|
||||
sudo sed -i 's/^# *AutomaticLogin[[:space:]=].*/AutomaticLogin='"$username"'/' "$daemon_conf"
|
||||
echo -e "${GREEN}Autologin enabled for user: ${username}${NC}"
|
||||
else
|
||||
sudo sed -i 's/^AutomaticLoginEnable[[:space:]=].*/# AutomaticLoginEnable=false/' "$daemon_conf"
|
||||
sudo sed -i 's/^AutomaticLogin[[:space:]=].*/# AutomaticLogin=/' "$daemon_conf"
|
||||
echo -e "${GREEN}Autologin disabled.${NC}"
|
||||
fi
|
||||
;;
|
||||
wayland)
|
||||
local rules_link="/etc/udev/rules.d/61-gdm.rules"
|
||||
if [ -L "$rules_link" ] || [ -f "$rules_link" ]; then
|
||||
sudo rm -f "$rules_link"
|
||||
echo -e "${GREEN}Reverted. Wayland will be disabled by default on next reboot.${NC}"
|
||||
elif [ -f "/lib/udev/rules.d/61-gdm.rules" ]; then
|
||||
if _confirm "Wayland on NVIDIA" \
|
||||
"Force-enable Wayland on NVIDIA?\n\nRisk: This may break graphics or cause instability.\nProceed?"; then
|
||||
sudo ln -s /dev/null "$rules_link"
|
||||
echo -e "${GREEN}Wayland override created. Reboot required.${NC}"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
done
|
||||
_pause
|
||||
@@ -402,37 +402,37 @@ configure_sddm() {
|
||||
[ -z "$choice" ] && return
|
||||
clear
|
||||
case "$choice" in
|
||||
1)
|
||||
echo "sddm shared/default-x-display-manager select sddm" | sudo debconf-set-selections
|
||||
_run_cmd "SDDM" "sudo apt install -y sddm" "Installing SDDM..."
|
||||
;;
|
||||
2)
|
||||
local sddm_session=""
|
||||
local sddm_user="${SUDO_USER:-$USER}"
|
||||
if [ -f /usr/share/wayland-sessions/plasmawayland.desktop ]; then
|
||||
sddm_session="plasmawayland"
|
||||
elif [ -f /usr/share/wayland-sessions/lxqt-wayland.desktop ]; then
|
||||
sddm_session="lxqt-wayland"
|
||||
elif [ -f /usr/share/xsessions/plasma.desktop ]; then
|
||||
sddm_session="plasma"
|
||||
elif [ -f /usr/share/xsessions/lxqt.desktop ]; then
|
||||
sddm_session="lxqt"
|
||||
fi
|
||||
sudo mkdir -p /etc/sddm.conf.d
|
||||
cat << EOF | sudo tee /etc/sddm.conf.d/autologin.conf > /dev/null
|
||||
1)
|
||||
echo "sddm shared/default-x-display-manager select sddm" | sudo debconf-set-selections
|
||||
_run_cmd "SDDM" "sudo apt install -y sddm" "Installing SDDM..."
|
||||
;;
|
||||
2)
|
||||
local sddm_session=""
|
||||
local sddm_user="${SUDO_USER:-$USER}"
|
||||
if [ -f /usr/share/wayland-sessions/plasmawayland.desktop ]; then
|
||||
sddm_session="plasmawayland"
|
||||
elif [ -f /usr/share/wayland-sessions/lxqt-wayland.desktop ]; then
|
||||
sddm_session="lxqt-wayland"
|
||||
elif [ -f /usr/share/xsessions/plasma.desktop ]; then
|
||||
sddm_session="plasma"
|
||||
elif [ -f /usr/share/xsessions/lxqt.desktop ]; then
|
||||
sddm_session="lxqt"
|
||||
fi
|
||||
sudo mkdir -p /etc/sddm.conf.d
|
||||
cat <<EOF | sudo tee /etc/sddm.conf.d/autologin.conf >/dev/null
|
||||
[Autologin]
|
||||
User=${sddm_user}
|
||||
Session=${sddm_session}
|
||||
Relogin=false
|
||||
EOF
|
||||
if [ -n "$sddm_session" ]; then
|
||||
echo -e "${GREEN}Autologin enabled for user ${sddm_user}, session: ${sddm_session}.${NC}"
|
||||
else
|
||||
echo -e "${YELLOW}Autologin enabled for user ${sddm_user}. No session set (SDDM will use default).${NC}"
|
||||
fi
|
||||
_pause
|
||||
;;
|
||||
3) return ;;
|
||||
if [ -n "$sddm_session" ]; then
|
||||
echo -e "${GREEN}Autologin enabled for user ${sddm_user}, session: ${sddm_session}.${NC}"
|
||||
else
|
||||
echo -e "${YELLOW}Autologin enabled for user ${sddm_user}. No session set (SDDM will use default).${NC}"
|
||||
fi
|
||||
_pause
|
||||
;;
|
||||
3) return ;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user