Compare commits

..

2 Commits

Author SHA1 Message Date
91d53625f5 make portprotonqt-desktop-return simply
Signed-off-by: Boris Yumankulov <boria138@altlinux.org>
2025-07-12 12:32:21 +05:00
33e06fb5ec fix autologin
Signed-off-by: Boris Yumankulov <boria138@altlinux.org>
2025-07-12 11:53:15 +05:00
3 changed files with 10 additions and 26 deletions

View File

@@ -1,4 +1,4 @@
[Seat:*]
#autologin-user=
#autologin-user-timeout=
#autologin-session=
#autologin-user=
autologin-user-timeout=

View File

@@ -5,22 +5,5 @@
CONFIG_FILE="$HOME/.config/gamescope-session-type"
if [[ -f "$CONFIG_FILE" ]] && grep -q 'autologin=true' "$CONFIG_FILE"; then
XDG_DESKTOP=$(echo "${XDG_CURRENT_DESKTOP,,}")
if [[ "$XDG_DESKTOP" == *gnome* ]]; then
exec gnome-session-quit --no-prompt
elif [[ "$XDG_DESKTOP" == *kde* ]]; then
VERSION=$(grep -E '^X-KDE-PluginInfo-Version=' /usr/share/xsessions/plasmax11.desktop 2>/dev/null | cut -d'=' -f2)
if [[ "$VERSION" =~ ^6\..* ]]; then
exec qdbus org.kde.Shutdown /Shutdown org.kde.Shutdown.logout
else
exec qdbus org.kde.ksmserver /KSMServer logout 0 0 0
fi
elif [[ "$XDG_DESKTOP" == *mate* ]]; then
exec mate-session-save --force-logout
elif [[ "$XDG_DESKTOP" == *hyprland* ]]; then
exec loginctl terminate-user "$(id -u)"
elif [[ "$XDG_DESKTOP" == *xfce* ]]; then
exec xfce4-session-logout --logout
fi
exec loginctl terminate-user "$(id -u)"
fi

View File

@@ -17,7 +17,7 @@ mkdir -p "${config_dir}/environment.d"
[[ -f "$config_dir/$SENTINEL_FILE" ]] && source "$config_dir/$SENTINEL_FILE"
session="${1:-gamescope}"
session="${1:-portprotonqt}"
session_launcher=""
create_sentinel=""
@@ -45,9 +45,9 @@ update_config_sentinel() {
}
configure_lightdm() {
sed -i "s/^.*autologin-user=.*/autologin-user=${USER}/" /etc/lightdm/lightdm.conf.d/10-gamescope-session.conf
sed -i "s/^.*autologin-user-timeout=.*/autologin-user-timeout=0/" /etc/lightdm/lightdm.conf.d/10-gamescope-session.conf
sed -i "s/^.*autologin-session=.*/autologin-session=$session_launcher/" /etc/lightdm/lightdm.conf.d/10-gamescope-session.conf
sed -i "s/^.*autologin-user=.*/autologin-user=${USER}/" /etc/lightdm/lightdm.conf.d/10-gamescope-session.conf
systemctl reset-failed lightdm
systemctl restart lightdm
}
@@ -55,11 +55,12 @@ configure_sddm() {
sed -i "s/^.*Relogin=.*/Relogin=true/" /etc/sddm.conf.d/10-gamescope-session.conf
sed -i "s/^.*Session=.*/Session=$session_launcher/" /etc/sddm.conf.d/10-gamescope-session.conf
sed -i "s/^.*User=.*/User=${USER}/" /etc/sddm.conf.d/10-gamescope-session.conf
systemctl reset-failed sddm
systemctl restart sddm
}
yad_question() {
yad --window-icon="/usr/share/icons/hicolor/scalable/actions/steamdeck-gaming-return.svg" --image="/usr/share/icons/hicolor/scalable/actions/steamdeck-gaming-return.svg" --question --title="$1" --text="$2" --width=300 --text-align=center
yad --window-icon="/usr/share/icons/hicolor/scalable/actions/portprotonqt-gaming-return.svg" --image="/usr/share/icons/hicolor/scalable/actions/portprotonqt-gaming-return.svg" --question --title="$1" --text="$2" --width=300 --text-align=center
[[ "$?" != 0 ]] && return 1 || return 0
}
@@ -132,7 +133,7 @@ if [[ ! -z $4 ]]; then
fi
if systemctl is-active --quiet gdm; then
yad --window-icon="/usr/share/icons/hicolor/scalable/actions/steamdeck-gaming-return.svg" --image="/usr/share/icons/hicolor/scalable/actions/steamdeck-gaming-return.svg" --title="Требуется подтверждение" --text="Для работы данной функции требуется LIGHTDM или SDDM, GDM не поддерживается" --width=290 --text-align=center --button="OK"
yad --window-icon="/usr/share/icons/hicolor/scalable/actions/portprotonqt-gaming-return.svg" --image="/usr/share/icons/hicolor/scalable/actions/portprotonqt-gaming-return.svg" --title="Требуется подтверждение" --text="Для работы данной функции требуется LIGHTDM или SDDM, GDM не поддерживается" --width=290 --text-align=center --button="OK"
if [[ -f "$config_dir/$SENTINEL_FILE" ]]; then
if grep -iq "autologin" "$config_dir/$SENTINEL_FILE"; then
if ! grep -q "autologin=false" "$config_dir/$SENTINEL_FILE"; then
@@ -149,7 +150,7 @@ if systemctl is-active --quiet gdm; then
die "Autologin configuration aborted due to GDM."
fi
if ! grep -iq "autologin" "$config_dir/$SENTINEL_FILE" && [[ "$2" == "desktop" ]]; then
if ! grep -iq "autologin" "$config_dir/$SENTINEL_FILE"; then
if yad_question "Требуется подтверждение" "Для работы данной функции требуется настроить автологин. Хотите ли вы, чтобы это было настроено автоматически?" ; then
echo "autologin=true" >> "$config_dir/$SENTINEL_FILE"
echo "autologin enabled"