From 107601c27d8e9bdac54c3a2b0279eaf869454d30 Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Sun, 25 May 2025 19:15:52 +0530 Subject: keyboard layout script --- .scripts/switch-keyboard-layout | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 .scripts/switch-keyboard-layout (limited to '.scripts/switch-keyboard-layout') 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 -- cgit v1.2.3