Created
February 22, 2021 14:13
-
-
Save ndgnuh/114988c522b4e5a3a1d205c43e4c55dd to your computer and use it in GitHub Desktop.
IBus engine cycling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # chỉnh bộ gõ ở đây {{{ # | |
| engines="xkb:us::eng, Bamboo" | |
| # }}} chỉnh bộ gõ ở đây # | |
| engines=$(echo $engines | sed s'/\s//g') | |
| first_engine=$(echo $engines | cut -d ',' -f 1) | |
| cur_next_engines=$(echo $engines \ | |
| | tr ',' '\n' \ | |
| | grep $(ibus engine) -A 1 \ | |
| ) | |
| # echo $cur_next_engines | |
| next_engine=$(echo $cur_next_engines \ | |
| | tr ' ' '\n' \ | |
| | tail -n 1 \ | |
| ) | |
| if [ "$cur_next_engines" = "$next_engine" ]; then | |
| next_engine=$first_engine | |
| fi | |
| # echo $next_engine | |
| ibus engine $next_engine |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment