From b67f9a5a4748de0dc67cbe528dbd6c5ad350d32b Mon Sep 17 00:00:00 2001 From: mia26MAjFm Date: Sat, 4 Jul 2026 23:47:09 -0400 Subject: [PATCH] cachyos: pkill plasmashell + kwin before switching to gamescope --- distros/cachyos/files/steamos-session-select | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/distros/cachyos/files/steamos-session-select b/distros/cachyos/files/steamos-session-select index 28dd7dc..31861f5 100755 --- a/distros/cachyos/files/steamos-session-select +++ b/distros/cachyos/files/steamos-session-select @@ -65,11 +65,16 @@ sudo "$(realpath "$0")" "$session" case "$session" in gamescope) + # Plasma's compositor + shell run under systemd --user (session 2), + # not the tty1 login session — terminate-session alone leaves them + # holding DRM and gamescope can't grab the display. Kill them first, + # then close the tty1 session so profile.d exec's gamescope-session-ps5. + pkill -u steam plasmashell || true + pkill -u steam kwin_wayland || true + pkill -u steam kwin_x11 || true + pkill -u steam Xwayland || true if [[ -n "${XDG_SESSION_ID:-}" ]]; then loginctl terminate-session "$XDG_SESSION_ID" - else - pkill -u steam kwin_wayland || true - pkill -u steam kwin_x11 || true fi ;; desktop|plasma|plasma-wayland|plasmax11)