blob: 1dcf7298c6800ad72c5c6d3404e7526f6f6bb6f6 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#!/bin/sh
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' \
~/.xkb/symbols/mango \
| sort \
| nl -v0 -nln \
| osel
`"
then
hyprctl switchxkblayout $KEYBOARD ${choice% *} >/dev/null
notify "${0##*/}" keyboard 'Keyboard Layout Changed' \
"The keyboard layout was changed to ‘${choice##* }’"
fi
|