From: Christian Heller Date: Mon, 17 Mar 2025 23:55:43 +0000 (+0100) Subject: Improve status script; X-Git-Url: https://plomlompom.com/repos/%22https:/validator.w3.org/todo?a=commitdiff_plain;h=6141955345af7eb8489bbc23979b3c5b5cd92cc5;p=config Improve status script; --- diff --git a/testing/home/t490s/.nonpath_bins/status.sh b/testing/home/t490s/.nonpath_bins/status.sh index b6fddc9..a1b965e 100755 --- a/testing/home/t490s/.nonpath_bins/status.sh +++ b/testing/home/t490s/.nonpath_bins/status.sh @@ -92,7 +92,19 @@ print_datetime() { TZ=$(date +'/%Z') print_bar_block "${DATE} " "" 0 print_bar_block "${TIME}" "${COL_WHITE}" 0 - print_bar_block "${TZ}" "" 0 + print_bar_block "${TZ}" "" +} + +print_keyboard() { + LAYOUT=$(swaymsg -t get_inputs | grep 'xkb_active_layout_name' | sed -E 's/[ ,"]+//g' | cut -d':' -f2 | head -1) + if [ "${LAYOUT}" = "English(US)" ]; then + LAYOUT=us + elif [ "${LAYOUT}" = "German" ]; then + LAYOUT=de + else + LAYOUT=?? + fi + print_bar_block "k:${LAYOUT}" } printf '{"version": 1}\n[' @@ -102,6 +114,7 @@ while true; do print_battery print_temperature print_datetime + print_keyboard printf '],' sleep 0.1 done