Compare commits
6 Commits
960b808457
...
main
Author | SHA1 | Date | |
---|---|---|---|
8aa326c000
|
|||
91d53625f5
|
|||
33e06fb5ec
|
|||
cc42d327ee
|
|||
db3668adf1
|
|||
51a542254d
|
@@ -1,4 +1,4 @@
|
|||||||
[Seat:*]
|
[Seat:*]
|
||||||
#autologin-user=
|
|
||||||
#autologin-user-timeout=
|
|
||||||
#autologin-session=
|
#autologin-session=
|
||||||
|
#autologin-user=
|
||||||
|
autologin-user-timeout=
|
||||||
|
@@ -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,,}")
|
|
||||||
|
|
||||||
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)"
|
exec loginctl terminate-user "$(id -u)"
|
||||||
elif [[ "$XDG_DESKTOP" == *xfce* ]]; then
|
|
||||||
exec xfce4-session-logout --logout
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
@@ -22,7 +22,9 @@ set +a
|
|||||||
|
|
||||||
# Gamescope parameters
|
# Gamescope parameters
|
||||||
: "${OUTPUT_CONNECTOR:=*,eDP-1}"
|
: "${OUTPUT_CONNECTOR:=*,eDP-1}"
|
||||||
GAMESCOPE_PARAMS="--prefer-output $OUTPUT_CONNECTOR"
|
: "${XWAYLAND_COUNT:=2}"
|
||||||
|
|
||||||
|
GAMESCOPE_PARAMS="--prefer-output $OUTPUT_CONNECTOR --xwayland-count $XWAYLAND_COUNT"
|
||||||
|
|
||||||
# Check if NVK driver is in use
|
# Check if NVK driver is in use
|
||||||
if vulkaninfo 2>/dev/null | grep -i "driverName" | grep -q "NVK"; then
|
if vulkaninfo 2>/dev/null | grep -i "driverName" | grep -q "NVK"; then
|
@@ -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,8 +109,11 @@ 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
|
||||||
|
if [[ "$KDE6" == "true" ]]; then
|
||||||
session_launcher="plasma"
|
session_launcher="plasma"
|
||||||
[[ "$KDE6" != "true" ]] && session_launcher="plasmawayland"
|
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* && "$de_normalized" != *unicorn* ]]; then
|
elif [[ "$de_normalized" == *xfce* && "$de_normalized" != *unicorn* ]]; then
|
||||||
@@ -100,8 +125,15 @@ 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
|
||||||
|
if [[ "$KDE6" == "true" ]]; then
|
||||||
|
if [[ "$HAS_KDE_X11" == "true" ]]; then
|
||||||
session_launcher="plasmax11"
|
session_launcher="plasmax11"
|
||||||
[[ "$KDE6" != "true" ]] && session_launcher="plasma"
|
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
|
elif [[ "$de_normalized" == *unicorn* ]]; then
|
||||||
@@ -132,7 +164,7 @@ 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"
|
||||||
if [[ -f "$config_dir/$SENTINEL_FILE" ]]; then
|
if [[ -f "$config_dir/$SENTINEL_FILE" ]]; then
|
||||||
if grep -iq "autologin" "$config_dir/$SENTINEL_FILE"; then
|
if grep -iq "autologin" "$config_dir/$SENTINEL_FILE"; then
|
||||||
if ! grep -q "autologin=false" "$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."
|
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"
|
@@ -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
|
||||||
|
@@ -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 |
@@ -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 |
Reference in New Issue
Block a user