Skip to content

Commit

Permalink
- Updated setup.py installer to set the IBus Input Method for the ins…
Browse files Browse the repository at this point in the history
…taller if it is not currently set as the default.
  • Loading branch information
rbreaves committed Feb 19, 2020
1 parent 6b0f3fc commit e6dbd5e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,7 @@ If you need kintox11 recompiled for your distro please let me know and I will ad

You can also attempt to compile kintox11.c on your system as well, but you will need to compile and install json-c first as its libraries will be required to compile and run the program.

*IBUS is needed to support wordwise during browser app usage as the keymap will need to change slightly depending if the cursor/caret is on screen waiting for input. You may install ibus with the following.

```
ibus-setup
im-config -n ibus
```
!! Please logoff and back on for IBus change to take effect!
*IBUS is needed to support wordwise during browser app usage as the keymap will need to change slightly depending if the cursor/caret is on screen waiting for input. Setup.py will set it but you can manually set it as well or check your current Input Method.

To confirm navigate to your "Language Support" and set "Keyboard input method system:" to IBus for full word-wise support with web browsers.

Expand Down
24 changes: 23 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
import json, time, os
import json, time, os, sys
from shutil import copyfile
from subprocess import PIPE, Popen
from prekinto import *
Expand All @@ -23,6 +23,16 @@ def requirements():
os.system("sudo apt-get install -y " + run_pkg)
print("\n")

def install_ibus():
print(bcolors.CYELLOW + "You need to set IBus as the default Input Method for full word-wise support and re-run this installer.\n" + bcolors.ENDC)
print("im-config -n ibus\n")
run_install = yn_choice(bcolors.CYELLOW + "Would you like to run it now? (Will require logoff and logon.)\n" + bcolors.ENDC)
if(run_install):
os.system("im-config -n ibus")
print("\n")
input("IBus has been set as the default Input Method.\nPress any key to exit and re-run after logoff & logon...")
sys.exit()

check_xbind = symbols_gui_line = cmdline("which xbindkeys").strip()
check_xdotool = symbols_gui_line = cmdline("which xdotool").strip()

Expand All @@ -41,6 +51,18 @@ def requirements():
if runpkg != 0:
requirements()

if os.path.exists(homedir + '/.config/ibus/bus') and cmdline("ls ~/.config/ibus/bus -1rt") == "":
install_ibus()



try:
f = open("defaults.json")
except IOError:
print("defaults.json file is missing. Will exit.\n")
exit()
f.close()

try:
f = open("defaults.json")
except IOError:
Expand Down

0 comments on commit e6dbd5e

Please sign in to comment.