From 6141955345af7eb8489bbc23979b3c5b5cd92cc5 Mon Sep 17 00:00:00 2001
From: Christian Heller <c.heller@plomlompom.de>
Date: Tue, 18 Mar 2025 00:55:43 +0100
Subject: [PATCH] Improve status script;

---
 testing/home/t490s/.nonpath_bins/status.sh | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

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
-- 
2.30.2