feat(waybar): add custom language layout indicator script

This commit is contained in:
pyrschtjag committed 2026-10-30 11:09:50 +04:00
1 parent ce3c0735c6
commit 4e3c4e6470
1 file changed
+16
+16
View File
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
print_layout() {
swaymsg -t get_inputs | jq -r '
[.[] | select(.type=="keyboard" and .xkb_active_layout_name != null)]
| first | .xkb_active_layout_name
| if test("Russian") then "RU"
elif test("English") then "EN"
else .[0:2] end'
}
while true; do
print_layout
swaymsg -t subscribe -m '["input"]' | while read -r _; do
print_layout
done
sleep 1
done