Skip to content

Latest commit

 

History

History
35 lines (25 loc) · 675 Bytes

README.md

File metadata and controls

35 lines (25 loc) · 675 Bytes

xkblayout-subscribe

simple program that subscribes to X's keyboard layout change event and outputs the keyboard layout everytime it changes.

install

arch users can use the AUR package: paru -S xkblayout-subscribe-git

install: make; sudo make install

remove: sudo make uninstall

example usage

this command notifies current keyboard layout upon keyboard layout change:

xkblayout-subscribe | xargs -L1 sh -c '
    case $0 in
        0) lang=en ;;
        1) lang=fa ;;
    esac
    notify-send "$lang"
'

or you can install and use xkblayout-state:

xkblayout-subscribe |
    xargs -L1 sh -c 'notify-send $(xkblayout-state print %s)'