Merge pull request #95 from rbreaves/hotfix

- Windows 10 & WSL Support Added
This commit is contained in:
Ben Reaves
2020-04-04 21:19:42 -05:00
committed by GitHub
15 changed files with 83 additions and 2 deletions

View File

@@ -28,6 +28,12 @@ Kinto works for standard Windows, Apple and Chromebook keyboards. The following
- IBus* - IBus*
- Fedora/RHEL/Manjaro/Arch/Debian/Ubuntu based distro 16.04+ - 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. 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. *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.

View File

@@ -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...") input("IBus has been set as the default Input Method.\nPress any key to exit and re-run after logoff & logon...")
sys.exit() 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").strip()
check_x11 = cmdline("env | grep -i x11 || loginctl show-session \"$XDG_SESSION_ID\" -p Type | awk -F= '{print $2}'").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: if len(check_x11) == 0:
if os.name != 'nt':
print("You are not using x11, please logout and back in using x11/Xorg") print("You are not using x11, please logout and back in using x11/Xorg")
sys.exit() sys.exit()
else:
print("You are detected as running Windows.")
windows_setup()
sys.exit()
check_xbind = cmdline("which xbindkeys 2>/dev/null").strip() check_xbind = cmdline("which xbindkeys 2>/dev/null").strip()
check_xdotool = cmdline("which xdotool 2>/dev/null").strip() check_xdotool = cmdline("which xdotool 2>/dev/null").strip()

12
windows/autohotkey.ps1 Normal file
View File

@@ -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
}

30
windows/kinto.ahk Normal file
View File

@@ -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

Binary file not shown.

Binary file not shown.

BIN
windows/macbook_winctrl_swap.skl Executable file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
windows/standard_ctrlalt_swap.skl Executable file

Binary file not shown.

BIN
windows/theme_campbell.reg Normal file

Binary file not shown.

BIN
windows/theme_legacy.reg Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
windows/theme_ubuntu.reg Normal file

Binary file not shown.