Skip to content

Instantly share code, notes, and snippets.

@ergoz
Forked from lucsoft/GnomeNested.sh
Created May 3, 2025 16:40
Show Gist options
  • Save ergoz/41068899663be1fce569508c31648e33 to your computer and use it in GitHub Desktop.
Save ergoz/41068899663be1fce569508c31648e33 to your computer and use it in GitHub Desktop.
Run plasma from within gamescope
#!/bin/sh
# Remove the performance overlay, it meddles with some tasks
unset LD_PRELOAD
# Fetch Resolution
RES=$(xdpyinfo | awk '/dimensions/{print $2}')
# Apply Resolution in env and start a new nested gnome with a new dbus
env MUTTER_DEBUG_DUMMY_MODE_SPECS=$RES dbus-run-session -- gnome-shell --wayland --nested
#!/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