Compare commits

...

11 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
ccfe455fb4 drop chimeraos session
Signed-off-by: Boris Yumankulov <boria138@altlinux.org>
2025-07-05 12:19:57 +05:00
c3e994ab10 fix: prevert multiple autologin config write on using GDM
Signed-off-by: Boris Yumankulov <boria138@altlinux.org>
2025-06-10 16:52:34 +05:00
aed7041e7b feat(session-select): added Unicorn support (Rhino Linux XFCE rebrending)
Signed-off-by: Boris Yumankulov <boria138@altlinux.org>
2025-06-10 09:11:17 +05:00
11 changed files with 183 additions and 60 deletions

View File

@@ -1,26 +1,46 @@
# PortProtonQt session # PortProtonQt session
This project is not affiliated with Valve (wide inspiration was taken from 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 ## Basic manual setup
Copy this repository file structure into the appropriate places and you'll be 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. able to start the session on any Display Manager of your choice.
# Configuration # User Configuration
The session sources environment from `~/.config/environment.d/*.conf` files. 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.conf` The easiest way to configure the session is to create `~/.config/environment.d/gamescope-session-plus.conf`
and set variables there: and set variables there:
``` ```bash
# Override entire PortProtonQt command line # Size of the screen. If not set gamescope will detect native resolution from drm.
CLIENTCMD="portprotonqtqt" SCREEN_HEIGHT=2160
SCREEN_WIDTH=3840
# Override the entire Gamescope command line # Internal render size of the screen. If not set, will be the same as SCREEN_HEIGHT and SCREEN_WIDTH.
# This will not use screen and render sizes INTERNAL_WIDTH=1280
GAMESCOPECMD="gamescope -e -f" 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 # License & Contributing

View File

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

View File

@@ -1,26 +1,9 @@
#!/usr/bin/env bash #!/usr/bin/env bash
/usr/bin/portproton-session-select portprotonqt /usr/bin/portprotonqt-session-select portprotonqt
CONFIG_FILE="$HOME/.config/gamescope-session-type" CONFIG_FILE="$HOME/.config/gamescope-session-type"
if [[ -f "$CONFIG_FILE" ]] && grep -q 'autologin=true' "$CONFIG_FILE"; then if [[ -f "$CONFIG_FILE" ]] && grep -q 'autologin=true' "$CONFIG_FILE"; then
XDG_DESKTOP=$(echo "${XDG_CURRENT_DESKTOP,,}") exec loginctl terminate-user "$(id -u)"
if [[ "$XDG_DESKTOP" == *gnome* || "$XDG_DESKTOP" == *onix* ]]; 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
fi 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" [[ -f "$config_dir/$SENTINEL_FILE" ]] && source "$config_dir/$SENTINEL_FILE"
session="${1:-gamescope}" session="${1:-portprotonqt}"
session_launcher="" session_launcher=""
create_sentinel="" create_sentinel=""
@@ -45,9 +45,9 @@ update_config_sentinel() {
} }
configure_lightdm() { 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-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 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/^.*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/^.*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 sed -i "s/^.*User=.*/User=${USER}/" /etc/sddm.conf.d/10-gamescope-session.conf
systemctl reset-failed sddm
systemctl restart sddm systemctl restart sddm
} }
yad_question() { 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 [[ "$?" != 0 ]] && return 1 || return 0
} }
@@ -68,17 +69,38 @@ if [[ -z $SENTINEL_CREATED ]]; then
export SENTINEL_CREATED=1 export SENTINEL_CREATED=1
fi fi
if [[ -f /usr/share/xsessions/plasmax11.desktop ]]; then KDE6=""
version=$(grep -E '^X-KDE-PluginInfo-Version=' /usr/share/xsessions/plasmax11.desktop | cut -d'=' -f2) HAS_KDE_X11=""
if [[ $version =~ ^6.* ]]; then KDE_VERSION=""
KDE6="true"
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 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 fi
de_normalized="${DE,,}" de_normalized="${DE,,}"
# TODO: Check ALT Workstation session_launcher # TODO: Check ALT Workstation session_launcher
case "$session" in case "$session" in
desktop) desktop)
if [[ "$SESSION_TYPE" == "wayland" ]]; then if [[ "$SESSION_TYPE" == "wayland" ]]; then
@@ -87,11 +109,14 @@ case "$session" in
elif [[ "$de_normalized" == *gnome* ]]; then elif [[ "$de_normalized" == *gnome* ]]; then
session_launcher="gnome-wayland" session_launcher="gnome-wayland"
elif [[ "$de_normalized" == *kde* ]]; then elif [[ "$de_normalized" == *kde* ]]; then
session_launcher="plasma" if [[ "$KDE6" == "true" ]]; then
[[ "$KDE6" != "true" ]] && session_launcher="plasmawayland" session_launcher="plasma"
else
session_launcher="plasmawayland"
fi
elif [[ "$de_normalized" == *hyprland* ]]; then elif [[ "$de_normalized" == *hyprland* ]]; then
session_launcher="hyprland" session_launcher="hyprland"
elif [[ "$de_normalized" == *xfce* ]]; then elif [[ "$de_normalized" == *xfce* && "$de_normalized" != *unicorn* ]]; then
session_launcher="xfce-wayland" session_launcher="xfce-wayland"
fi fi
else else
@@ -100,10 +125,19 @@ case "$session" in
elif [[ "$de_normalized" == *gnome* ]]; then elif [[ "$de_normalized" == *gnome* ]]; then
session_launcher="gnome-xorg" session_launcher="gnome-xorg"
elif [[ "$de_normalized" == *kde* ]]; then elif [[ "$de_normalized" == *kde* ]]; then
session_launcher="plasmax11" if [[ "$KDE6" == "true" ]]; then
[[ "$KDE6" != "true" ]] && session_launcher="plasma" 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 elif [[ "$de_normalized" == *mate* ]]; then
session_launcher="mate" session_launcher="mate"
elif [[ "$de_normalized" == *unicorn* ]]; then
session_launcher="unicorn"
elif [[ "$de_normalized" == *xfce* ]]; then elif [[ "$de_normalized" == *xfce* ]]; then
session_launcher="xfce" session_launcher="xfce"
fi fi
@@ -130,12 +164,24 @@ if [[ ! -z $4 ]]; then
fi fi
if systemctl is-active --quiet gdm; then 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"
echo "autologin=false" >> "$config_dir/$SENTINEL_FILE" 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
sed -i 's/autologin=.*/autologin=false/' "$config_dir/$SENTINEL_FILE"
echo "autologin set to false"
else
echo "autologin already set to false"
fi
else
echo "autologin=false" >> "$config_dir/$SENTINEL_FILE"
echo "autologin added as false"
fi
fi
die "Autologin configuration aborted due to GDM." die "Autologin configuration aborted due to GDM."
fi 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 if yad_question "Требуется подтверждение" "Для работы данной функции требуется настроить автологин. Хотите ли вы, чтобы это было настроено автоматически?" ; then
echo "autologin=true" >> "$config_dir/$SENTINEL_FILE" echo "autologin=true" >> "$config_dir/$SENTINEL_FILE"
echo "autologin enabled" echo "autologin enabled"

View File

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

View File

@@ -1,3 +0,0 @@
#!/usr/bin/env bash
CLIENTCMD="portprotonqt --fullscreen"

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

View File

@@ -3,7 +3,7 @@
<policyconfig> <policyconfig>
<vendor>PortProtonQt</vendor> <vendor>PortProtonQt</vendor>
<vendor_url>https://git.linux-gaming.ru/Boria138</vendor_url> <vendor_url>https://git.linux-gaming.ru/Boria138</vendor_url>
<action id="org.shadowblip.pkexec.run-session-select"> <action id="org.linux_gaming.pkexec.run-session-select">
<description>Helper to switch sessions</description> <description>Helper to switch sessions</description>
<icon_name>package-x-generic</icon_name> <icon_name>package-x-generic</icon_name>
<defaults> <defaults>

View File

@@ -2,6 +2,6 @@
Encoding=UTF-8 Encoding=UTF-8
Name=PortProtonQt Name=PortProtonQt
Comment=PortProtonQt Session Comment=PortProtonQt Session
Exec=gamescope-session-plus portprotonqt Exec=portprotonqt-gamescope
Type=Application Type=Application
DesktopNames=gamescope DesktopNames=gamescope