diff --git a/usr/bin/portproton-session-select b/usr/bin/portproton-session-select index 484e3ba..f07997a 100755 --- a/usr/bin/portproton-session-select +++ b/usr/bin/portproton-session-select @@ -57,7 +57,7 @@ configure_sddm() { } yad_question() { - env GDK_BACKEND="x11" 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/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 [[ "$?" != 0 ]] && return 1 || return 0 } @@ -81,6 +81,8 @@ case "$session" in elif [[ "$DE" == "KDE" ]]; then session_launcher="plasma" [[ "$KDE6" != "true" ]] && session_launcher="plasmawayland" + elif [[ "$DE" == "Hyprland" ]]; then + session_launcher="hyprland" fi else if [[ "$DE" == "GNOME" ]]; then @@ -95,7 +97,7 @@ case "$session" in create_sentinel=1 ;; gamescope) - session_launcher="gamescope-session-steam" + session_launcher="gamescope-session-portprotonqt" create_sentinel=1 ;; *) @@ -110,12 +112,12 @@ if [[ ! -z $4 ]]; then fi if systemctl is-active --quiet gdm; then - env GDK_BACKEND="x11" 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/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" echo "autologin=false" >> "$config_dir/$SENTINEL_FILE" die "Autologin configuration aborted due to GDM." fi -if ! grep -iq "autologin" "$config_dir/$SENTINEL_FILE" || [[ "$2" == "plasma" ]] || [[ "$2" == "desktop" ]] ; then +if ! grep -iq "autologin" "$config_dir/$SENTINEL_FILE" && [[ "$2" == "desktop" ]]; then if yad_question "Требуется подтверждение" "Для работы данной функции требуется настроить автологин. Хотите ли вы, чтобы это было настроено автоматически?" ; then echo "autologin=true" >> "$config_dir/$SENTINEL_FILE" echo "autologin enabled" diff --git a/usr/bin/portprotonqt-desktop-return b/usr/bin/portprotonqt-desktop-return new file mode 100755 index 0000000..df6c0a1 --- /dev/null +++ b/usr/bin/portprotonqt-desktop-return @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +/usr/bin/portproton-session-select gamescope + +CONFIG_FILE="$HOME/.config/gamescope-session-type" + +if [[ -f "$CONFIG_FILE" ]] && grep -q 'autologin="true"' "$CONFIG_FILE"; then + case "$XDG_CURRENT_DESKTOP" in + GNOME) + exec gnome-session-quit --no-prompt + ;; + KDE) + 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 + ;; + MATE) + exec mate-session-save --force-logout + ;; + Hyprland) + exec loginctl terminate-user "$(id -u)" + ;; + esac +fi diff --git a/usr/share/applications/portprotonqt_return.desktop b/usr/share/applications/portprotonqt_return.desktop index 19775d4..e340a71 100644 --- a/usr/share/applications/portprotonqt_return.desktop +++ b/usr/share/applications/portprotonqt_return.desktop @@ -1,6 +1,6 @@ [Desktop Entry] Name=Return to PortProtonQt -Exec=portproton-session-select gamescope +Exec=portprotonqt-desktop-return Icon=steamdeck-gaming-return Terminal=false Type=Application