summaryrefslogtreecommitdiff
path: root/.local/bin/chkb
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2023-09-12 12:12:16 +0200
committerThomas Voss <mail@thomasvoss.com> 2023-09-12 12:12:16 +0200
commitef1b2cf64bc9d6975c520602609369cd1ff6173b (patch)
tree677c49be553eda99c5c7ef783322375a92ae749c /.local/bin/chkb
parent3de1b5030becd33b05c44c6dcdc20e5b43b1f257 (diff)
chkb: Hardcode keyboard
Diffstat (limited to '.local/bin/chkb')
-rwxr-xr-x.local/bin/chkb5
1 files changed, 2 insertions, 3 deletions
diff --git a/.local/bin/chkb b/.local/bin/chkb
index 4927564..a61e7d9 100755
--- a/.local/bin/chkb
+++ b/.local/bin/chkb
@@ -5,6 +5,7 @@ set -e
OSEL_GUI_FLAGS='-r "echo \"%s\" | cut -f2 | xargs echo -n"'
export OSEL_GUI_FLAGS="$OSEL_GUI_FLAGS -Oalphabetical"
export OSEL_TERM_FLAGS='--with-nth=2..'
+readonly KEYBOARD=at-translated-set-2-keyboard
if choice="`
sed -En 's/\s*name\[Group1\]\s*=\s*"([^"]*)"\s*;\s*/\1/p' \
@@ -14,9 +15,7 @@ if choice="`
| osel
`"
then
- hyprctl -j devices \
- | jq -r '.keyboards[-1].name' \
- | xargs -I{} hyprctl switchxkblayout {} ${choice% *} >/dev/null
+ hyprctl switchxkblayout $KEYBOARD ${choice% *} >/dev/null
notify-send -a "${0##*/}" -u normal 'Keyboard Layout Changed' \
"The keyboard layout was changed to ‘${choice##* }’."
fi