From e6dbd5ea13fd9599b645038e98a2362e62b04ec1 Mon Sep 17 00:00:00 2001 From: Ryan Reaves Date: Tue, 18 Feb 2020 21:20:01 -0600 Subject: [PATCH] - Updated setup.py installer to set the IBus Input Method for the installer if it is not currently set as the default. --- README.md | 8 +------- setup.py | 24 +++++++++++++++++++++++- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 9e9e91ad..abfd14f8 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/setup.py b/setup.py index f72751fc..d336f81c 100755 --- a/setup.py +++ b/setup.py @@ -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 * @@ -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() @@ -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: