Skip to content

Instantly share code, notes, and snippets.

@5paceToast 5paceToast/ibus-toggle
Last active Feb 13, 2018

Embed
What would you like to do?
Ibus toggler for wayland. Define IIM (like PATH, but with ';' as a separator) in your environment, and keybind your change-language key to this script.
#!/bin/zsh
# set IIM like path, but with ;, and containing the list of IMs you want, in order
typeset -T IIM iim \;
local engine=$(ibus engine)
local cur=${iim[(i)$engine]}
local size=${#iim}
(( size > 1 )) || exit
(( cur > size )) && (( cur = 0 )) # custom engine - reset to default
(( cur++ ))
(( cur > size )) && (( cur -= size ))
ibus engine ${iim[$cur]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.