Merge pull request #97 from rbreaves/hotfix

- Added uninstall option for Windows
This commit is contained in:
Ben Reaves
2020-04-04 21:36:38 -05:00
committed by GitHub
2 changed files with 17 additions and 11 deletions

View File

@@ -37,7 +37,7 @@ def install_ibus():
sys.exit() sys.exit()
def windows_setup(): def windows_setup():
keymaps = ["Apple keyboard standard", "Apple keyboard w/ Caps lock as Esc", "Windows keyboard standard", "Windows keyboard w/ Caps lock as Esc"] keymaps = ["Apple keyboard standard", "Apple keyboard w/ Caps lock as Esc", "Windows keyboard standard", "Windows keyboard w/ Caps lock as Esc","Uninstall"]
for index, item in enumerate(keymaps): for index, item in enumerate(keymaps):
print(" %i. %s" % (index+1, item.capitalize())) print(" %i. %s" % (index+1, item.capitalize()))
default = 0 default = 0
@@ -53,6 +53,9 @@ def windows_setup():
os.system("regedit " + path + "\\windows\\standard_ctrlalt_swap.reg") os.system("regedit " + path + "\\windows\\standard_ctrlalt_swap.reg")
elif default == 4: elif default == 4:
os.system("regedit " + path + "\\windows\\standard_ctrlalt_capsesc_swap.reg") os.system("regedit " + path + "\\windows\\standard_ctrlalt_capsesc_swap.reg")
elif default == 5:
os.system("regedit " + path + "\\windows\\remove_keyswap.reg")
if default > 0 and default < 5:
print("Will now install chocolatey and autohotkey with elevated privileges...") print("Will now install chocolatey and autohotkey with elevated privileges...")
print("This install will fail if you are not running with elevated privileges") print("This install will fail if you are not running with elevated privileges")
os.system('powershell -executionpolicy bypass ".\\windows\\autohotkey.ps1"') os.system('powershell -executionpolicy bypass ".\\windows\\autohotkey.ps1"')
@@ -62,6 +65,8 @@ def windows_setup():
os.system("copy /Y " + path + "\\windows\\kinto.ahk \"C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp\\kinto.ahk\"") os.system("copy /Y " + path + "\\windows\\kinto.ahk \"C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp\\kinto.ahk\"")
print("\nPlease log off and back on for changes to take full effect.") print("\nPlease log off and back on for changes to take full effect.")
print("If using WSL then please remember to right click on title bar -> Properties -> Edit Options -> Use Ctrl+Shift+C/V as Copy/Paste and enable it.") print("If using WSL then please remember to right click on title bar -> Properties -> Edit Options -> Use Ctrl+Shift+C/V as Copy/Paste and enable it.")
else:
os.system("del \"C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp\\kinto.ahk\"")
# check_x11 = cmdline("env | grep -i x11").strip() # check_x11 = cmdline("env | grep -i x11").strip()

View File

@@ -1,3 +1,4 @@
Windows Registry Editor Version 5.00 Windows Registry Editor Version 5.00
[-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout\Scancode Map] [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=-