mirror of https://github.com/bvn13/dotfiles.git
16 lines
428 B
Bash
16 lines
428 B
Bash
#!/bin/bash
|
|
|
|
swaymsg -t get_inputs | jq -r \
|
|
"first(.[]|select(.identifier == \"$1\" and .type == \"keyboard\")) \
|
|
| .xkb_active_layout_name \
|
|
| .[0:2] \
|
|
| ascii_upcase"
|
|
|
|
swaymsg -mrt subscribe '["input"]' | jq -r --unbuffered \
|
|
"select(.change == \"xkb_layout\")
|
|
| .input
|
|
| select(.identifier == \"$1\" and .type == \"keyboard\") \
|
|
| .xkb_active_layout_name \
|
|
| .[0:2] \
|
|
| ascii_upcase"
|