Skip to content

Instantly share code, notes, and snippets.

@lucsoft
Forked from davidedmundson/PlasmaNested.sh
Last active January 8, 2024 22:52
Show Gist options
  • Save lucsoft/40c929537e083f1984d4dedd393eae80 to your computer and use it in GitHub Desktop.
Save lucsoft/40c929537e083f1984d4dedd393eae80 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
@mathieuf20
Copy link

In the PlasmaNested file, the last line seems to miss a character (should be wrapper and not wrapp)

@lucsoft
Copy link
Author

lucsoft commented Nov 1, 2023

In the PlasmaNested file, the last line seems to miss a character (should be wrapper and not wrapp)

Thanks fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment