Last active
May 2, 2025 13:23
-
-
Save p-fruck/c262aebba3be5debe23f656680dce2db to your computer and use it in GitHub Desktop.
Toggle swap_alt_win on gnome desktop (MX Keys for Mac on Linux with EurKEY US 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/sh | |
| set -e | |
| regular="@as []" | |
| swapped="['altwin:swap_lalt_lwin', 'lv3:rwin_switch']" | |
| current=$(gsettings get org.gnome.desktop.input-sources xkb-options) | |
| if [ "${current}" == "${regular}" ]; then | |
| echo "Switching to Mac keyboard" | |
| gsettings set org.gnome.desktop.input-sources xkb-options "${swapped}" | |
| elif [ "${current}" == "${swapped}" ]; then | |
| echo "Switching to normal keyboard" | |
| gsettings set org.gnome.desktop.input-sources xkb-options "${regular}" | |
| else | |
| echo "WTF is the current config?" | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment