Skip to content

Commit

Permalink
Merge pull request #41 from rbreaves/dev
Browse files Browse the repository at this point in the history
- Added support for Fedora and rpm/dnf based distros
  • Loading branch information
rbreaves authored Feb 21, 2020
2 parents 4bb6f89 + 524fe93 commit 1c51db9
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ def cmdline(command):
)
return process.communicate()[0]

def requirements():
def requirements(pkgm):
print(bcolors.CYELLOW + "You need to install some packages, " +run_pkg+ ", for Kinto to fully remap browsers during input focus.\n" + bcolors.ENDC)
print("sudo apt-get install -y " + run_pkg + "\n")
run_install = yn_choice(bcolors.CYELLOW + "Would you like to run it now? (Will require sudo privileges.)\n" + bcolors.ENDC)
if(run_install):
os.system("sudo apt-get install -y " + run_pkg)
os.system("sudo " + pkgm + " install -y " + run_pkg)
print("\n")

def install_ibus():
Expand All @@ -33,8 +33,22 @@ def install_ibus():
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()
check_x11 = cmdline("env | grep -i x11").strip()

if len(check_x11) == 0:
print("You are not using x11, please logout and back in using x11/Xorg")
sys.exit()

check_xbind = cmdline("which xbindkeys 2>/dev/null").strip()
check_xdotool = cmdline("which xdotool 2>/dev/null").strip()
pkgm = cmdline("which apt 2>/dev/null").strip()

if len(pkgm) == 0:
pkgm = cmdline("which dnf 2>/dev/null").strip()
if len(pkgm) == 0:
print("No supported package manager found. Exiting...")
sys.exit()


runpkg = 0
run_pkg = ""
Expand All @@ -49,7 +63,7 @@ def install_ibus():
runpkg = 1

if runpkg != 0:
requirements()
requirements(pkgm)

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

0 comments on commit 1c51db9

Please sign in to comment.