aboutsummaryrefslogtreecommitdiffstats
path: root/.scripts/switch-keyboard-layout
diff options
context:
space:
mode:
authorVidhu Kant Sharma <vidhukant@vidhukant.com>2025-05-25 19:15:52 +0530
committerVidhu Kant Sharma <vidhukant@vidhukant.com>2025-05-25 19:15:52 +0530
commit107601c27d8e9bdac54c3a2b0279eaf869454d30 (patch)
tree094f6feff06acb4e090f4b0917fff65bbb86853d /.scripts/switch-keyboard-layout
parent3e729e5561bdbda1bb02ee80b6e2f8b6bec6d8f7 (diff)
keyboard layout script
Diffstat (limited to '.scripts/switch-keyboard-layout')
-rwxr-xr-x.scripts/switch-keyboard-layout11
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