added new script :D

This commit is contained in:
Solomon Laing 2022-11-08 20:04:13 +10:30
parent 88cc5448b9
commit 053f34024b

24
scripts/kbswitcher Executable file
View File

@ -0,0 +1,24 @@
#!/usr/bin/env bash
fn="/tmp/kbswitcher.status"
layout=""
# first run the file won't exist
if [ ! -f "$fn" ]; then
layout="dvorak"
echo "dvorak" > "$fn"
else
case $(cat "$fn") in
us)
echo "dvorak" > "$fn"
layout="dvorak"
;;
dvorak)
echo "us" > "$fn"
layout="us"
;;
esac
fi
setxkbmap -layout "$layout" -option ctrl:nocaps