feat: Update launch scripts for improved Gamescope and Steam integration, add custom EDID firmware, and enhance session management

This commit is contained in:
2025-11-10 14:07:12 +01:00
parent df2931ca81
commit 0cf0261359
5 changed files with 241 additions and 25 deletions
@@ -10,17 +10,19 @@ start_gamescope() {
CONF_FILE="$HOME/.config/gamescope/gamescope.conf"
[ -f "$CONF_FILE" ] && source "$CONF_FILE"
OUTPUT_CONNECTOR=${OUTPUT_CONNECTOR:-HDMI-A-1}
FRAMERATE=${FRAMERATE:-60}
RESOLUTION=${RESOLUTION:-1920x1080}
WIDTH="${RESOLUTION%x*}"
HEIGHT="${RESOLUTION#*x}"
# export __GL_GSYNC_ALLOWED=1
# export __GL_VRR_ALLOWED=1
# # export __GL_THREADED_OPTIMIZATIONS=1
# export __GL_SHADER_DISK_CACHE=1
# export __GL_SYNC_TO_VBLANK=0
export __GL_GSYNC_ALLOWED=1
export __GL_VRR_ALLOWED=1
export __GL_SHADER_DISK_CACHE=1
export __GL_SYNC_TO_VBLANK=0
export LIBVA_DRIVER_NAME=nvidia
export __GLX_VENDOR_LIBRARY_NAME=nvidia
export NVD_BACKEND=direct
# export __GL_THREADED_OPTIMIZATIONS=1
GAMESCOPE_BIN="$(command -v gamescope || true)"
if [ -z "$GAMESCOPE_BIN" ]; then
@@ -36,8 +38,6 @@ start_gamescope() {
log "HDR disabled, no HDR flag added"
fi
env | tee -a "$LOG_FILE"
# Build gamescope argument array for safe quoting and readability
GAMESCOPE_ARGS=(
--generate-drm-mode fixed
@@ -47,7 +47,6 @@ start_gamescope() {
-W "$WIDTH" -H "$HEIGHT"
-w "$WIDTH" -h "$HEIGHT"
--rt --mangoapp -e
-O "$OUTPUT_CONNECTOR"
-r "$FRAMERATE"
)
@@ -56,8 +55,12 @@ start_gamescope() {
GAMESCOPE_ARGS+=("$HDR_FLAG")
fi
log "Launching Gamescope: $GAMESCOPE_BIN ${GAMESCOPE_ARGS[*]} -- $*"
export XDG_CURRENT_DESKTOP=gamescope
export XDG_SESSION_TYPE=wayland
export DESKTOP_SESSION=gamescope
log "Launching Gamescope: $GAMESCOPE_BIN ${GAMESCOPE_ARGS[*]} -- $*"
sudo setcap 'CAP_SYS_NICE=eip' "$GAMESCOPE_BIN"
# Execute gamescope inside a DBus session, preserving proper argument quoting
exec dbus-run-session -- "$GAMESCOPE_BIN" "${GAMESCOPE_ARGS[@]}" -- "$@" >>"$LOG_FILE" 2>&1
}
@@ -72,10 +75,7 @@ start_kwin() {
export XDG_CURRENT_DESKTOP=plasma
export XDG_SESSION_TYPE=wayland
export XDG_DATA_DIRS=/usr/local/share/:/usr/share/
export XDG_CONFIG_DIRS=/usr/local/etc/xdg:/etc/xdg
export XDG_CURRENT_DESKTOP=KDE
export XDG_RUNTIME_DIR=/run/user/$(id -u)
export DESKTOP_SESSION=plasma-wayland
# Ensure we don't run nested; width/height/fullscreen are for the windowed backend.
unset DISPLAY WAYLAND_DISPLAY
@@ -85,6 +85,9 @@ start_kwin() {
}
export XDG_SEAT=seat0
export XDG_RUNTIME_DIR=/run/user/$(id -u)
export XDG_DATA_DIRS=/usr/local/share/:/usr/share/
export XDG_CONFIG_DIRS=/usr/local/etc/xdg:/etc/xdg
if [[ -f "$HOME/.desktop-session-plasma" ]]; then
log "Plasma session selected."