Created
February 17, 2026 14:14
-
-
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 ðŸ«
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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