summaryrefslogtreecommitdiff
path: root/.local/bin/chkb
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2023-11-18 20:21:50 +0100
committerThomas Voss <mail@thomasvoss.com> 2023-11-18 20:21:50 +0100
commitfd2c508cde1393cbaf4d25abdf9eaebbe5f73895 (patch)
treedbb46663dc495da2ffdd5d7da66c2b6c38de5eb4 /.local/bin/chkb
parentf8f144c9810fd6f16f843de4297cc20498a11291 (diff)
bin/sbin: Use the new ‘notify’ API
Diffstat (limited to '.local/bin/chkb')
-rwxr-xr-x.local/bin/chkb8
1 files changed, 6 insertions, 2 deletions
diff --git a/.local/bin/chkb b/.local/bin/chkb
index b2f0d64..ac27e98 100755
--- a/.local/bin/chkb
+++ b/.local/bin/chkb
@@ -2,6 +2,9 @@
set -e
+export NOTIFY_LONG=keyboard
+export NOTIFY_SHORT=${0##*/}
+
readonly KEYBOARD=at-translated-set-2-keyboard
s="$(
@@ -19,8 +22,9 @@ s="$(
if choice="$(echo "$s" | osel)"
then
- n="$(echo "$s" | sed -n "/$choice/=" | xargs expr -1 +)"
+ echo "$s"
+ n="$(echo "$s" | sed -n "/$choice/=" | { xargs expr -1 + || true; })"
hyprctl switchxkblayout $KEYBOARD $n >/dev/null
- notify "${0##*/}" keyboard 'Keyboard Layout Changed' \
+ notify 'Keyboard Layout Changed' \
"The keyboard layout was changed to ‘$choice’"
fi