Skip to content

Instantly share code, notes, and snippets.

@atomtigerzoo
Created February 17, 2026 14:14
Show Gist options
  • Select an option

  • Save atomtigerzoo/6418b6e917975036a0a359ade158ebbe to your computer and use it in GitHub Desktop.

Select an option

Save atomtigerzoo/6418b6e917975036a0a359ade158ebbe to your computer and use it in GitHub Desktop.
Toggle right monitor: KDE (Plasma 6x, Wayland) user script to use as shortcut (choose to replace Meta+p) for enabling and disabling (toggle!) just the right monitor and no longer press the default Meta+p several times and choose the right layout 🫠
#!/bin/bash
# - Disable default meta+p in shortcuts (Display configuration)
# - Create a new shortcut referencing this script
# - Use meta+p as shortcut
# - 🎉
if kscreen-doctor -j | jq -e '.outputs[] | select(.name=="DP-2") | .enabled' > /dev/null; then
kscreen-doctor output.DP-2.disable
kdialog --passivepopup "Right monitor disabled" 2 --icon=monitor
else
kscreen-doctor output.DP-2.enable output.DP-2.position.2560,0
kdialog --passivepopup "Right monitor enabled" 2 --icon=monitor
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment