Skip to content

Instantly share code, notes, and snippets.

@vtkhang
Created November 8, 2020 13:11
Show Gist options
  • Select an option

  • Save vtkhang/380156264898b7f275c50333f42e166e to your computer and use it in GitHub Desktop.

Select an option

Save vtkhang/380156264898b7f275c50333f42e166e to your computer and use it in GitHub Desktop.
Fix bug IBus 1.5.22 on LinuxLite Xfce Desktop: Can't use shorcut key (Ex: Super + Space) to change input method from xkb:us::eng to Unikey.
"""Change the IBus method from xkb:us::eng to Unikey and vice versa.
Using this file by:
1> Open Setings -> Keyboard -> Application Shorcuts.
2> Add the keyboard shorcut with the command : python <path_to_this_file>.py
Notice:
- Make sure IBus daemon is running and auto start on boot.
- Unikey have been added.
"""
import os
cur_engine = os.popen('ibus engine').read()
if 'xkb:us::eng' in cur_engine:
os.popen('ibus engine Unikey')
else:
os.popen('ibus engine xkb:us::eng')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment