feat: added portprotonqt-desktop-return script and added Hyprland support to it

Signed-off-by: Boris Yumankulov <boria138@altlinux.org>
This commit is contained in:
2025-06-09 22:34:14 +05:00
parent e9b7dc3759
commit 9352d0d900
3 changed files with 34 additions and 5 deletions

View File

@ -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"

View File

@ -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

View File

@ -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