Skip to content

Instantly share code, notes, and snippets.

@cornradio
Last active November 22, 2024 07:07
Show Gist options
  • Save cornradio/0bb1d71d895909130257135cf2afb6b7 to your computer and use it in GitHub Desktop.
Save cornradio/0bb1d71d895909130257135cf2afb6b7 to your computer and use it in GitHub Desktop.
steamdeck_desktopmode.sh
#!/bin/bash
unset LD_PRELOAD
unset XDG_DESKTOP_PORTAL_DIR
unset XDG_SEAT_PATH
unset XDG_SESSION_PATH
RES=$(xdpyinfo | awk '/dimensions/{print $2}')
# Shadow kwin_wayland_wrapper so that we can pass args to kwin wrapper
# whilst being launched by plasma-session
mkdir $XDG_RUNTIME_DIR/nested_kde -p
cat <<EOF > $XDG_RUNTIME_DIR/nested_kde/kwin_wayland_wrapper
#!/bin/sh
/usr/bin/kwin_wayland_wrapper --width $(echo "$RES" | cut -d 'x' -f 1) --height $(echo "$RES" | cut -d 'x' -f 2) --no-lockscreen \$@
EOF
chmod a+x $XDG_RUNTIME_DIR/nested_kde/kwin_wayland_wrapper
export PATH=$XDG_RUNTIME_DIR/nested_kde:$PATH
dbus-run-session startplasma-wayland
rm $XDG_RUNTIME_DIR/nested_kde/kwin_wayland_wrapper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment