summaryrefslogtreecommitdiff
path: root/.local/bin/layouttoggle
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin/layouttoggle')
-rwxr-xr-x.local/bin/layouttoggle24
1 files changed, 24 insertions, 0 deletions
diff --git a/.local/bin/layouttoggle b/.local/bin/layouttoggle
new file mode 100755
index 0000000..4742080
--- /dev/null
+++ b/.local/bin/layouttoggle
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+layout=$(cat $HOME/.cache/layout)
+
+case "$layout" in
+ ca) setxkbmap -model pc104 -layout us -variant ,,
+ echo us > $HOME/.cache/layout
+ # pkill -RTMIN+46 dwmblocks
+ $SCRIPTS/cron/dwmbar
+ ;;
+ us) setxkbmap -model pc104 -layout ca -variant ,,
+ echo ca > $HOME/.cache/layout
+ # pkill -RTMIN+46 dwmblocks
+ $SCRIPTS/cron/dwmbar
+ ;;
+ *) setxkbmap -model pc104 -layout us -variant ,,
+ echo us > $HOME/.cache/layout
+ # pkill -RTMIN+46 dwmblocks
+ $SCRIPTS/cron/dwmbar
+ ;;
+ esac
+
+# [[ "$layout" == "us" ]] && setxkbmap -model pc104 -layout ca -variant ,, ; echo ca > $HOME/.cache/layout && $SCRIPTS/cron/dwmbar
+# [[ "$layout" == "us" ]] || setxkbmap -model pc104 -layout ca -variant ,, ; echo ca > $HOME/.cache/layout && $SCRIPTS/cron/dwmbar