From fd2c508cde1393cbaf4d25abdf9eaebbe5f73895 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sat, 18 Nov 2023 20:21:50 +0100 Subject: bin/sbin: Use the new ‘notify’ API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .local/bin/chkb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to '.local/bin/chkb') 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 -- cgit v1.2.3