Compare commits

...

8 Commits

Author SHA1 Message Date
8aa326c000 fix autologin work on non X11 kde6
Signed-off-by: Boris Yumankulov <boria138@altlinux.org>
2025-07-13 12:15:42 +05:00
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
cc42d327ee added XWAYLAND_COUNT
Signed-off-by: Boris Yumankulov <boria138@altlinux.org>
2025-07-11 17:13:59 +05:00
db3668adf1 rename portproton to portprotonqt
Signed-off-by: Boris Yumankulov <boria138@altlinux.org>
2025-07-11 17:05:51 +05:00
51a542254d Added own icon to desktop return thanks to @Dervart
Signed-off-by: Boris Yumankulov <boria138@altlinux.org>
2025-07-11 16:17:52 +05:00
960b808457 feat: added compatibility with ChimeraOS configuration and device-quirks
Signed-off-by: Boris Yumankulov <boria138@altlinux.org>
2025-07-09 21:25:14 +05:00
cf0b11ea3e fix: added workaround for work with nvk
Signed-off-by: Boris Yumankulov <boria138@altlinux.org>
2025-07-09 20:49:58 +05:00
9 changed files with 172 additions and 74 deletions

View File

@@ -1,13 +1,48 @@
# PortProtonQt session
This project is not affiliated with Valve (wide inspiration was taken from
their work on the SteamDeck). This configuration depends on [gamescope-session](https://raw.githubusercontent.com/ChimeraOS/gamescope-session) from the ChimeraOS project. and [portprotonqt](https://git.linux-gaming.ru/Boria138/PortProtonQt)
their work on the SteamDeck)
## Basic manual setup
Copy this repository file structure into the appropriate places and you'll be
able to start the session on any Display Manager of your choice.
# User Configuration
The session sources environment from `~/.config/environment.d/*.conf` files.
The easiest way to configure the session is to create `~/.config/environment.d/gamescope-session-plus.conf`
and set variables there:
```bash
# Size of the screen. If not set gamescope will detect native resolution from drm.
SCREEN_HEIGHT=2160
SCREEN_WIDTH=3840
# Internal render size of the screen. If not set, will be the same as SCREEN_HEIGHT and SCREEN_WIDTH.
INTERNAL_WIDTH=1280
INTERNAL_HEIGHT=800
# Orientation adjustment of panel, possible values: left, right
ORIENTATION=left
# Enable VRR
ADAPTIVE_SYNC=1
# Treat the internal panel as an external monitor
PANEL_TYPE=external
# Set priority of display connectors
OUTPUT_CONNECTOR='*,DSI-1'
# Set the specific values allowed for refresh rates
CUSTOM_REFRESH_RATES=40,50,60
# DRM mode generation algorithm (cvt, fixed)
# TODO: what is this ?
DRM_MODE=fixed
```
# License & Contributing
The project is licensed under GPL v3 license. If you want to contribute,

View File

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

View File

@@ -1,29 +0,0 @@
#!/usr/bin/env bash
# Source user configuration from ~/.config/environment.d
set -a
for i in "${HOME}"/.config/environment.d/*.conf; do
[[ -f "${i}" ]] && . "${i}"
done
set +a
# Fix intel color corruption
# might come with some performance degradation but is better than a corrupted
# color image
export INTEL_DEBUG=norbc
export mesa_glthread=true
# This should be used by default by gamescope. Cannot hurt to force it anyway.
# Reported better framelimiting with this enabled
export ENABLE_GAMESCOPE_WSI=1
# Some environment variables by default (taken from Deck session)
export SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS=0
# Add custom vulkan adapter if specified
if [ -n "$VULKAN_ADAPTER" ]; then
GAMESCOPECMD= " --prefer-vk-device $VULKAN_ADAPTER"
fi
# Start client application
gamescope $GAMESCOPECMD -- portprotonqt --fullscreen

View File

@@ -1,26 +1,9 @@
#!/usr/bin/env bash
/usr/bin/portproton-session-select portprotonqt
/usr/bin/portprotonqt-session-select portprotonqt
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

83
usr/bin/portprotonqt-gamescope Executable file
View File

@@ -0,0 +1,83 @@
#!/usr/bin/env bash
gamescope_has_option() {
if (gamescope --help 2>&1 | grep -e "$1" > /dev/null); then
return 0
fi
return 1
}
# Source device quirks if exists
if [ -f /usr/share/gamescope-session-plus/device-quirks ]; then
. /usr/share/gamescope-session-plus/device-quirks
fi
# Source user configuration from ~/.config/environment.d
set -a
for i in "${HOME}"/.config/environment.d/*.conf; do
[[ -f "${i}" ]] && . "${i}"
done
set +a
# Gamescope parameters
: "${OUTPUT_CONNECTOR:=*,eDP-1}"
: "${XWAYLAND_COUNT:=2}"
GAMESCOPE_PARAMS="--prefer-output $OUTPUT_CONNECTOR --xwayland-count $XWAYLAND_COUNT"
# Check if NVK driver is in use
if vulkaninfo 2>/dev/null | grep -i "driverName" | grep -q "NVK"; then
# Workaround for https://gitlab.freedesktop.org/mesa/mesa/-/issues/13478
BACKEND="sdl"
GAMESCOPE_PARAMS+=" -f"
fi
if [ -n "$SCREEN_WIDTH" ] && [ -n "$SCREEN_HEIGHT" ]; then
GAMESCOPE_PARAMS+=" -W $SCREEN_WIDTH -H $SCREEN_HEIGHT"
fi
if [ -n "$INTERNAL_WIDTH" ] && [ -n "$INTERNAL_HEIGHT" ] ; then
GAMESCOPE_PARAMS+=" -w $INTERNAL_WIDTH -h $INTERNAL_HEIGHT"
fi
if [ -n "$DRM_MODE" ] ; then
GAMESCOPE_PARAMS+=" --generate-drm-mode $DRM_MODE"
fi
if [ -n "$ORIENTATION" ] ; then
GAMESCOPE_PARAMS+=" --force-orientation $ORIENTATION"
fi
if [ -n "$ADAPTIVE_SYNC" ]; then
GAMESCOPE_PARAMS+=" --adaptive-sync"
fi
if [ -n "$PANEL_TYPE" ] && gamescope_has_option "--force-panel-type"; then
GAMESCOPE_PARAMS+=" --force-panel-type $PANEL_TYPE"
fi
if [ -n "$CUSTOM_REFRESH_RATES" ] && gamescope_has_option "--custom-refresh-rates"; then
GAMESCOPE_PARAMS+=" --custom-refresh-rates $CUSTOM_REFRESH_RATES"
fi
if [ -n "$USE_ROTATION_SHADER" ] && gamescope_has_option "--use-rotation-shader"; then
GAMESCOPE_PARAMS+=" --use-rotation-shader $USE_ROTATION_SHADER"
fi
if [ -n "$BACKEND" ] && gamescope_has_option "--backend"; then
GAMESCOPE_PARAMS+=" --backend $BACKEND"
fi
if [ -f "$CURSOR_FILE" ]; then
# Use specified cursor if file exists
GAMESCOPE_PARAMS+=" --cursor ${CURSOR_FILE}"
fi
# Prefer a specific Vulkan adapter if defined
if [ -n "$VULKAN_ADAPTER" ]; then
GAMESCOPE_PARAMS+=" --prefer-vk-device $VULKAN_ADAPTER"
fi
# Start client application with Gamescope
gamescope $GAMESCOPE_PARAMS -- portprotonqt --fullscreen

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
}
@@ -68,17 +69,38 @@ if [[ -z $SENTINEL_CREATED ]]; then
export SENTINEL_CREATED=1
fi
if [[ -f /usr/share/xsessions/plasmax11.desktop ]]; then
version=$(grep -E '^X-KDE-PluginInfo-Version=' /usr/share/xsessions/plasmax11.desktop | cut -d'=' -f2)
if [[ $version =~ ^6.* ]]; then
KDE6="true"
KDE6=""
HAS_KDE_X11=""
KDE_VERSION=""
for file in \
/usr/share/xsessions/plasmax11.desktop \
/usr/share/wayland-sessions/plasma.desktop \
/usr/share/wayland-sessions/plasmawayland.desktop \
/usr/share/xsessions/plasmax.desktop; do
if [[ -f "$file" ]]; then
version=$(grep -E '^X-KDE-PluginInfo-Version=' "$file" | cut -d'=' -f2)
if [[ -n "$version" ]]; then
KDE_VERSION="$version"
break
fi
fi
done
if [[ -n "$KDE_VERSION" && "${KDE_VERSION%%.*}" -ge 6 ]]; then
KDE6="true"
else
KDE6=""
fi
if [[ -f /usr/share/xsessions/plasmax11.desktop ]]; then
HAS_KDE_X11="true"
fi
de_normalized="${DE,,}"
# TODO: Check ALT Workstation session_launcher
case "$session" in
desktop)
if [[ "$SESSION_TYPE" == "wayland" ]]; then
@@ -87,8 +109,11 @@ case "$session" in
elif [[ "$de_normalized" == *gnome* ]]; then
session_launcher="gnome-wayland"
elif [[ "$de_normalized" == *kde* ]]; then
session_launcher="plasma"
[[ "$KDE6" != "true" ]] && session_launcher="plasmawayland"
if [[ "$KDE6" == "true" ]]; then
session_launcher="plasma"
else
session_launcher="plasmawayland"
fi
elif [[ "$de_normalized" == *hyprland* ]]; then
session_launcher="hyprland"
elif [[ "$de_normalized" == *xfce* && "$de_normalized" != *unicorn* ]]; then
@@ -100,8 +125,15 @@ case "$session" in
elif [[ "$de_normalized" == *gnome* ]]; then
session_launcher="gnome-xorg"
elif [[ "$de_normalized" == *kde* ]]; then
session_launcher="plasmax11"
[[ "$KDE6" != "true" ]] && session_launcher="plasma"
if [[ "$KDE6" == "true" ]]; then
if [[ "$HAS_KDE_X11" == "true" ]]; then
session_launcher="plasmax11"
else
die "KDE6 detected, but plasmax11 (X11 session) not available"
fi
else
session_launcher="plasma"
fi
elif [[ "$de_normalized" == *mate* ]]; then
session_launcher="mate"
elif [[ "$de_normalized" == *unicorn* ]]; then
@@ -132,7 +164,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 +181,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"

View File

@@ -1,7 +1,7 @@
[Desktop Entry]
Name=Return to PortProtonQt
Exec=portprotonqt-desktop-return
Icon=steamdeck-gaming-return
Icon=portprotonqt-gaming-return
Terminal=false
Type=Application
StartupNotify=false

View File

@@ -0,0 +1 @@
<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><g fill="#fff"><path d="m9.3201 8.0885v-1.0277h3.6483q0.80928 0 1.4066-0.51384 0.59735-0.51384 0.59735-1.2846 0-0.77076-0.59735-1.2846-0.59735-0.51384-1.4066-0.51384h-3.2372l1.336 1.336-0.71938 0.71938-2.5692-2.5692 2.5692-2.5692 0.71938 0.71938-1.336 1.336h3.2372q1.2461 0 2.1389 0.80929 0.89279 0.80929 0.89279 2.0168 0 1.2076-0.89279 2.0168-0.89279 0.80929-2.1389 0.80929z" stroke-width=".012846"/><path d="m16 7.7568v4.1862c0 0.51926-0.21175 0.99438-0.55517 1.3341-0.33894 0.34344-0.81033 0.55517-1.3296 0.55517h-12.226c-0.51926 0-0.99438-0.21175-1.3341-0.55517-0.34344-0.33968-0.55517-0.81481-0.55517-1.3341l7.6618e-4 -8.4714c0-0.51926 0.21175-0.99065 0.55517-1.3341 0.33894-0.34344 0.81481-0.55517 1.3341-0.55517h5.1725l0.011972 0.627c0.00374 0.13169 0.00823 0.25964 0.016461 0.38682l-5.2016 7.47e-4c-0.24018 0-0.4594 0.099513-0.61878 0.25964-0.15563 0.15563-0.25588 0.3756-0.25588 0.61503v8.4714c0 0.23943 0.099513 0.45865 0.25588 0.61878 0.16012 0.15563 0.37935 0.25588 0.61878 0.25588h12.226c0.23943 0 0.45567-0.09951 0.61503-0.25588 0.16012-0.16012 0.25588-0.37935 0.25588-0.61878v-3.1636c0.36738-0.30752 0.70707-0.65095 1.0138-1.0228z" stroke-width=".19154"/><rect x="2.9198" y="14.605" width="10.16" height="1.0146" rx=".57463" ry=".57463" stroke-width=".14456"/></g></svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -1,7 +0,0 @@
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg id="svg2" height="64" style="" viewBox="0 0 64 64" width="64" xmlns="http://www.w3.org/2000/svg" sodipodi:docname="deck_icon.svg" inkscape:version="1.2-dev (d2dd25d878, 2022-02-01, custom)" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:svg="http://www.w3.org/2000/svg">
<path id="path42220" d="m 32 4 v 10 a 18 18 0 0 1 18 18 a 18 18 0 0 1 -18 18 v 10 a 28 28 0 0 0 28 -28 a 28 28 0 0 0 -28 -28 z" style="fill:#fff;fill-rule:evenodd"/>
<circle id="path43518" cx="32" cy="32" r="14" style="fill:#1a9fff;fill-rule:evenodd"/>
<path id="path52048" d="m 32 22 a 2 2 0 0 0 -1.4140625 .5859375 l -8 8 a 2.0002 2.0002 0 0 0 0 2.828125 l 8 8 a 2 2 0 0 0 2.828125 0 a 2 2 0 0 0 0 -2.828125 l -4.5859375 -4.5859375 h 11.171875 a 2 2 0 0 0 2 -2 a 2 2 0 0 0 -2 -2 h -11.171875 l 4.5859375 -4.5859375 a 2 2 0 0 0 0 -2.828125 a 2 2 0 0 0 -1.4140625 -.5859375 z" style="fill:#fff;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:0"/>
<g id="path89696" style=""/>
</svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB