Skip to content

Subscribe to X keyboard layout events. useful for updating statusbars.

License

Notifications You must be signed in to change notification settings

koonix/xkblayout-subscribe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)'

About

Subscribe to X keyboard layout events. useful for updating statusbars.

Topics

Resources

License

Stars

Watchers

Forks