1 #!/bin/sh 2 # works on any init system 3 # requirements: dmenu, xorg-setxkbmap 4 5 kb="$(setxkbmap -query | grep -oP 'layout:\s*\K\w+')" || exit 1 6 7 printf "%s %s" "✍️" "${kb^^}" 8 9 # case $BLOCK_BUTTON in 10 # 1) kb_choice="$(awk '/! layout/{flag=1; next} /! variant/{flag=0} flag {print $2, "- " $1}' /usr/share/X11/xkb/rules/base.lst | dmenu -l 15)" 11 # kb="$(echo "$kb_choice" | awk '{print $3}')" 12 # setxkbmap "$kb" 13 # pkill -RTMIN+30 "${STATUSBAR:-dwmblocks}";; 14 # 3) notify-send "⌨ Keyboard/language module" "$(printf "%s" "\- Current layout: $(setxkbmap -query | grep -oP 'layout:\s*\K\w+')") 15 # - Left click to change keyboard.";; 16 # 6) "$TERMINAL" -e "$EDITOR" "$0" ;; 17 # esac 18 <<<<<<< HEAD 19 ======= 20 21 # printf "%s %s" "⌨️" "$kb" 22 # echo "⌨️: $kb" 23 >>>>>>> cecb3e8dd633fd5ba597ad536ffabd0c5f29726e