aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/.local/bin/swaykbd
blob: b0fc34acb6d719016d5ab19a36ea5c21333f4fdf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

swaymsg -r -t get_inputs | grep "xkb_active_layout_name" | awk -F '"' '{print $4}' | sed 's/ (US)//g'

swaymsg \
  --type subscribe \
  --monitor \
  --raw \
  '["input"]' | \
  jq \
    --raw-output \
    --unbuffered \ '
      select(.change == "xkb_layout") |
        .input.xkb_active_layout_name |
        sub(" \\(US\\)"; "")
    '

case $BLOCK_BUTTON in
    1) echo "TO-DO" ;;
esac;