Skip to content

Instantly share code, notes, and snippets.

@tarao
Created December 4, 2012 07:24
Show Gist options
  • Save tarao/4201522 to your computer and use it in GitHub Desktop.
Save tarao/4201522 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import sys
if len(sys.argv) > 1 and sys.argv[1] in ['on', 'off']:
import ibus
bus = ibus.Bus()
ic = ibus.InputContext(bus, bus.current_input_contxt())
getattr(ic, sys.argv[1].replace('on','en').replace('off','dis')+'able')()
else:
print 'Usage: ibus [on|off]'
sys.exit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment