feat(waybar): add custom language layout indicator script
This commit is contained in:
1 parent
ce3c0735c6
commit
4e3c4e6470
1 file changed
+16
Executable
+16
@@ -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
|
||||||
Reference in new issue
Block a user