From ffbea28e2f16161ad4f62078e5b20269243a7052 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Fri, 27 Feb 2026 20:56:50 +0100 Subject: chkb: Rewrite script to support Niri --- .local/sbin/chkb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 .local/sbin/chkb (limited to '.local/sbin/chkb') diff --git a/.local/sbin/chkb b/.local/sbin/chkb new file mode 100755 index 0000000..36398e3 --- /dev/null +++ b/.local/sbin/chkb @@ -0,0 +1,14 @@ +#!/bin/sh + +export NOTIFY_LONG=keyboard +export NOTIFY_SHORT="$(basename "$0")" + +readonly LAYOUTS="$(niri msg -j keyboard-layouts)" +sel="$(echo "$LAYOUTS" | jq -r '.names.[]' | osel -i)" +if [ -n "$sel" ] +then + niri msg action switch-layout "$sel" + choice="$(echo "$LAYOUTS" | jq -r ".names.[$sel]")" + notify 'Keyboard Layout Changed' \ + "The keyboard layout was changed to ‘$choice’" +fi -- cgit v1.2.3