diff options
author | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2025-05-25 19:15:52 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2025-05-25 19:15:52 +0530 |
commit | 107601c27d8e9bdac54c3a2b0279eaf869454d30 (patch) | |
tree | 094f6feff06acb4e090f4b0917fff65bbb86853d | |
parent | 3e729e5561bdbda1bb02ee80b6e2f8b6bec6d8f7 (diff) |
keyboard layout script
-rwxr-xr-x | .scripts/switch-keyboard-layout | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/.scripts/switch-keyboard-layout b/.scripts/switch-keyboard-layout new file mode 100755 index 0000000..124fd9c --- /dev/null +++ b/.scripts/switch-keyboard-layout @@ -0,0 +1,11 @@ +#!/bin/bash + +current_layout=$(setxkbmap -query | awk '/variant/{print $2}') + +if [[ "$current_layout" == "dvorak" ]]; then + setxkbmap -layout us -option caps:swapescape + notify-send "Keyboard Layout" "Switched to QWERTY" +else + setxkbmap -layout us -variant dvorak -option caps:swapescape + notify-send "Keyboard Layout" "Switched to Dvorak" +fi |