diff --git a/README.md b/README.md index b108f3e..ff3d96c 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,12 @@ Kinto works for standard Windows, Apple and Chromebook keyboards. The following - IBus* - Fedora/RHEL/Manjaro/Arch/Debian/Ubuntu based distro 16.04+ +- Windows 10 & WSL is now supported +- Powershell - run as Administrator (for install) +- Chocolatey (for install) +- Python (for install) +- Autohotkey + Binary is included and will be installed, but you can also compile kintox11.c on your system. 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. Setup.py will set it but you can manually set it as well or check your current Input Method. diff --git a/setup.py b/setup.py index ec4ddec..3b97c28 100755 --- a/setup.py +++ b/setup.py @@ -36,12 +36,45 @@ 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() +def windows_setup(): + keymaps = ["Apple keyboard standard", "Apple keyboard w/ Caps lock as Esc", "Windows keyboard standard", "Windows keyboard w/ Caps lock as Esc"] + for index, item in enumerate(keymaps): + print(" %i. %s" % (index+1, item.capitalize())) + default = 0 + while not int(default) in range(1,len(keymaps)+1): + default = int(input("\nPlease enter your desired keymap (1 - " + str(len(keymaps)) + ") : ")) + print("") + path= cmdline('echo %cd%')[:-1] + if default == 1: + os.system("regedit " + path + "\\windows\\macbook_winctrl_swap.reg") + elif default == 2: + os.system("regedit " + path + "\\windows\\macbook_winctrl_capsesc_swap.reg") + elif default == 3: + os.system("regedit " + path + "\\windows\\standard_ctrlalt_swap.reg") + elif default == 4: + os.system("regedit " + path + "\\windows\\standard_ctrlalt_capsesc_swap.reg") + print("Will now install chocolatey and autohotkey with elevated privileges...") + print("This install will fail if you are not running with elevated privileges") + os.system('powershell -executionpolicy bypass ".\\windows\\autohotkey.ps1"') + print("\nWill now install Ubuntu Terminal Theme as default...") + os.system("regedit " + path + "\\windows\\theme_ubuntu.reg") + print("Copying autohotkey combinations for Terminals & Editors...") + 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("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.") + + # check_x11 = cmdline("env | grep -i x11").strip() check_x11 = cmdline("env | grep -i x11 || loginctl show-session \"$XDG_SESSION_ID\" -p Type | awk -F= '{print $2}'").strip() if len(check_x11) == 0: - print("You are not using x11, please logout and back in using x11/Xorg") - sys.exit() + if os.name != 'nt': + print("You are not using x11, please logout and back in using x11/Xorg") + sys.exit() + else: + print("You are detected as running Windows.") + windows_setup() + sys.exit() check_xbind = cmdline("which xbindkeys 2>/dev/null").strip() check_xdotool = cmdline("which xdotool 2>/dev/null").strip() diff --git a/windows/autohotkey.ps1 b/windows/autohotkey.ps1 new file mode 100644 index 0000000..5dd7305 --- /dev/null +++ b/windows/autohotkey.ps1 @@ -0,0 +1,12 @@ +$testchoco = powershell choco -v +if(-not($testchoco)){ + Write-Output "Seems Chocolatey is not installed, installing now" + Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) +} +else{ + Write-Output "Chocolatey Version $testchoco is already installed" +} + +if(-not(test-path "C:\Program Files\AutoHotkey\AutoHotkey.exe")){ + choco install autohotkey.install +} diff --git a/windows/kinto.ahk b/windows/kinto.ahk new file mode 100644 index 0000000..eb1394f --- /dev/null +++ b/windows/kinto.ahk @@ -0,0 +1,30 @@ +#IfWinActive ahk_exe sublime_text.exe + ; Remap Ctrl+Shift to behave like macOS Sublimetext + ; Will extend cursor to multiple lines + #+Up::send {shift up}^!{Up} + #+Down::send {shift up}^!{Down} + + ; Remap Ctrl+Cmd+G to select all matches + #^g::send !{F3} +#If + +#IfWinActive ahk_exe ubuntu.exe + ^c::Send {LCtrl down}{LShift down}c{LCtrl Up}{LShift Up} + #c::Send {LCtrl down}c{LCtrl Up} + #x::Send {LCtrl down}x{LCtrl Up} + #o::Send {LCtrl down}o{LCtrl Up} + #r::Send {LCtrl down}r{LCtrl Up} + #w::Send {LCtrl down}w{LCtrl Up} + #\::Send {LCtrl down}\{LCtrl Up} + #k::Send {LCtrl down}k{LCtrl Up} + #u::Send {LCtrl down}u{LCtrl Up} + #j::Send {LCtrl down}j{LCtrl Up} + #t::Send {LCtrl down}t{LCtrl Up} + #_::Send {LCtrl down}_{LCtrl Up} + ^v::Send {LCtrl down}{LShift down}v{LCtrl Up}{LShift Up} +#If + +#IfWinActive ahk_exe powershell.exe + ^c::Send {LCtrl down}{LShift down}c{LCtrl Up}{LShift Up} + #c::Send {LCtrl down}c{LCtrl Up} +#If \ No newline at end of file diff --git a/windows/macbook_winctrl_capsesc_swap.reg b/windows/macbook_winctrl_capsesc_swap.reg new file mode 100644 index 0000000..d5f021c Binary files /dev/null and b/windows/macbook_winctrl_capsesc_swap.reg differ diff --git a/windows/macbook_winctrl_swap.reg b/windows/macbook_winctrl_swap.reg new file mode 100644 index 0000000..2d9406f Binary files /dev/null and b/windows/macbook_winctrl_swap.reg differ diff --git a/windows/macbook_winctrl_swap.skl b/windows/macbook_winctrl_swap.skl new file mode 100755 index 0000000..51aa778 Binary files /dev/null and b/windows/macbook_winctrl_swap.skl differ diff --git a/windows/standard_ctrlalt_capsesc_swap.reg b/windows/standard_ctrlalt_capsesc_swap.reg new file mode 100644 index 0000000..92d5c48 Binary files /dev/null and b/windows/standard_ctrlalt_capsesc_swap.reg differ diff --git a/windows/standard_ctrlalt_swap.reg b/windows/standard_ctrlalt_swap.reg new file mode 100644 index 0000000..81f487f Binary files /dev/null and b/windows/standard_ctrlalt_swap.reg differ diff --git a/windows/standard_ctrlalt_swap.skl b/windows/standard_ctrlalt_swap.skl new file mode 100755 index 0000000..8878230 Binary files /dev/null and b/windows/standard_ctrlalt_swap.skl differ diff --git a/windows/theme_campbell.reg b/windows/theme_campbell.reg new file mode 100644 index 0000000..84b272b Binary files /dev/null and b/windows/theme_campbell.reg differ diff --git a/windows/theme_legacy.reg b/windows/theme_legacy.reg new file mode 100644 index 0000000..ba748f7 Binary files /dev/null and b/windows/theme_legacy.reg differ diff --git a/windows/theme_onehalfdark.reg b/windows/theme_onehalfdark.reg new file mode 100644 index 0000000..9c0fcb9 Binary files /dev/null and b/windows/theme_onehalfdark.reg differ diff --git a/windows/theme_onehalflight.reg b/windows/theme_onehalflight.reg new file mode 100644 index 0000000..57ff8ed Binary files /dev/null and b/windows/theme_onehalflight.reg differ diff --git a/windows/theme_ubuntu.reg b/windows/theme_ubuntu.reg new file mode 100644 index 0000000..0aeb1df Binary files /dev/null and b/windows/theme_ubuntu.reg differ