From ca4f9be6eec6e755b9cd9cffa41d4b78f51c84ef Mon Sep 17 00:00:00 2001 From: Ben Reaves Date: Sat, 4 Apr 2020 04:15:46 -0500 Subject: [PATCH 1/3] - Added sharpkeys config and autohotkey script for mac on Windows parity --- windows/kinto.ahk | 15 +++++++++++++++ windows/macbook_winctrl_capsesc_swap.reg | Bin 0 -> 470 bytes windows/macbook_winctrl_swap.reg | Bin 0 -> 438 bytes windows/macbook_winctrl_swap.skl | Bin 0 -> 28 bytes windows/standard_ctrlalt_capsesc_swap.reg | Bin 0 -> 542 bytes windows/standard_ctrlalt_swap.reg | Bin 0 -> 518 bytes windows/standard_ctrlalt_swap.skl | Bin 0 -> 40 bytes 7 files changed, 15 insertions(+) create mode 100644 windows/kinto.ahk create mode 100644 windows/macbook_winctrl_capsesc_swap.reg create mode 100644 windows/macbook_winctrl_swap.reg create mode 100755 windows/macbook_winctrl_swap.skl create mode 100644 windows/standard_ctrlalt_capsesc_swap.reg create mode 100644 windows/standard_ctrlalt_swap.reg create mode 100755 windows/standard_ctrlalt_swap.skl diff --git a/windows/kinto.ahk b/windows/kinto.ahk new file mode 100644 index 0000000..a299907 --- /dev/null +++ b/windows/kinto.ahk @@ -0,0 +1,15 @@ +#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 \ 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 0000000000000000000000000000000000000000..d5f021cccea3acaa69a115578fa57e798dc187fb GIT binary patch literal 470 zcmb7>!AiqW5Jk^g@E=0gMOq{q!G#3DVxwS-B1Vd~K?9OVYSI3D+mk0x1>H!~5#IMhYt bi{LTQ(@*xd`m;0j8{(AikH;zBdAx%iy*xts literal 0 HcmV?d00001 diff --git a/windows/macbook_winctrl_swap.reg b/windows/macbook_winctrl_swap.reg new file mode 100644 index 0000000000000000000000000000000000000000..2d9406f06528105c05a0db7607c31fa614201a67 GIT binary patch literal 438 zcmb7=!AiqW6hzNj@E=0gMOtV!f(r?PrA-AZikMQg4Q-$#CADaOUOjmw*o7Mj@4Y*7 z=guAS{q;ma$&!i>c0}Bhvy$8KPR&8)#%>|1#1W77YrBQG6vtf9^E>A(oEL5xIrGe% zF?S?f`_4&y6MI7@b~C0braV}uqJ+J!wce$hlHlF!uh^){85-m990G##fGvZZ&WCRde;w{*B-E&k*(&~o)np-K UWTvCyI2oI@b!q-=>+)Ow0H7E^WdHyG literal 0 HcmV?d00001 diff --git a/windows/macbook_winctrl_swap.skl b/windows/macbook_winctrl_swap.skl new file mode 100755 index 0000000000000000000000000000000000000000..51aa77844dfb5eeca1eb92bfeb75d095bf162c1a GIT binary patch literal 28 ZcmZQzfB+UC75zY#K^8(MrQW5Jk_k;6H>u7ilR05qyv!C^iaK6fsh48#Ew^q!#VZt0x;`5$Zz;$DalMU2^A}={`v= zoMmjZRT}#725Jk_k;C~2xE>e-82tG&<6dMIAiZoKx1`S9esYUzeZBI7D4=4o*J3IHz zotYbU`E^S{$&`u@W<*?(^DH;xotlNriPb_>i6d^T*H#O0DUR7;;J3|IIAcyZx95%t zLoP`;_MVV>C)Uomu$nPaG2+@h6(!7_T06URQxax3`zu~m<#LUt+1Rm}TXOw9%08%^ z>SbuQ5YJWJ2RA*tpJYp8r6yOEir?sQ#EbZo!{ERFuei@T{jM82evgCiJl193T?6B9 fO%^;xdfKdRJ6lbg$NtaXiJLXe3w6$Z^6t%65qe0I literal 0 HcmV?d00001 diff --git a/windows/standard_ctrlalt_swap.skl b/windows/standard_ctrlalt_swap.skl new file mode 100755 index 0000000000000000000000000000000000000000..887823037908e87c003d38daef5494c9ee8f247c GIT binary patch literal 40 fcmZQzfB<$NCCgyJ5d8p3KCpNY^FS6%f>Zzig=z`P literal 0 HcmV?d00001 From 4d423de14b24700cb4f81f67486aacd2c8fd6c2d Mon Sep 17 00:00:00 2001 From: Ben Reaves Date: Sat, 4 Apr 2020 21:12:16 -0500 Subject: [PATCH 2/3] - Added Windows 10 Support --- setup.py | 37 +++++++++++++++++++++++++++-- windows/autohotkey.ps1 | 12 ++++++++++ windows/kinto.ahk | 41 ++++++++++++++++++++++----------- windows/theme_campbell.reg | Bin 0 -> 2124 bytes windows/theme_legacy.reg | Bin 0 -> 2124 bytes windows/theme_onehalfdark.reg | Bin 0 -> 2222 bytes windows/theme_onehalflight.reg | Bin 0 -> 2124 bytes windows/theme_ubuntu.reg | Bin 0 -> 1796 bytes 8 files changed, 75 insertions(+), 15 deletions(-) create mode 100644 windows/autohotkey.ps1 create mode 100644 windows/theme_campbell.reg create mode 100644 windows/theme_legacy.reg create mode 100644 windows/theme_onehalfdark.reg create mode 100644 windows/theme_onehalflight.reg create mode 100644 windows/theme_ubuntu.reg 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 index a299907..eb1394f 100644 --- a/windows/kinto.ahk +++ b/windows/kinto.ahk @@ -1,15 +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} + ^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/theme_campbell.reg b/windows/theme_campbell.reg new file mode 100644 index 0000000000000000000000000000000000000000..84b272b993f866f7eea2ae2463310471837c8cb1 GIT binary patch literal 2124 zcmbuA-EPxB5QXO&iFc^-08tz#aomav)KWk|Ri#NQ1jtJ5xJ2YnPApm;9{6S*)3{x) zLaWur-d&%WGqaO3e|}%dR2GuRQhv%>4rCw`xnXZD8_DF3oj06LSuI%~$R+0)r&HDo z)?H~zi}6xknE6HC$pC6Z$qVQ;|dOopsSa>4sRzH*}IHNP|LeKW`-tTp6R#uBr4 z#&gcIA+MMbPKm5n)VRBROcYHJSD8F8qcgcvo7L=FvSdscLUeP05@ z--T{l(Jdkyi^uRyzUzGZR&+wNroI_1_~XnU=t(gs;fMHlMu-e{Gor|R1Z zZBP|lp-t!fA5?D(wR@;Fr9!o~wO3kviqfj`9-^1$uvnr{8J_3p?x|792`nP1c7)e3 zT$%l2zFmM?@NLZdOx_wRIp-hQQ>E1y5<0?&yyqs~+#sqpBO>W@Hyyrg^VHegc9KYL z&AqGQ2V_4(MStKy??U_34P0W*@*NLNyxuZ*`-oe4>5qcfStek)LY+vGvZ~UaNJs+bN%4llPtfFL5eG1ONa4 literal 0 HcmV?d00001 diff --git a/windows/theme_legacy.reg b/windows/theme_legacy.reg new file mode 100644 index 0000000000000000000000000000000000000000..ba748f770c0cdfb80db9372345b22e8b821cbb71 GIT binary patch literal 2124 zcmbuA>rUH15QWcgq`pIx2Z%7&0P2s57Fx9+6cSL?A`4Ew4DN$d4G*U$kUFw>%k;WS8fs-#-JM8-GD>}hG#M)usW52GN zmbpG?$*o`ds_$TaD%P%A_-n8`RFi#6$2>Rm8;hYw{C4qo=8!vht7=c@YIAnT{f>K8 zA6YTiXLeVdreMbSYx1sn89Qq==Oa5eUw1I=l85<8$kDP$wCy+>Z+{to&mcn|gZ%r< zU>X^{;Iho~$Wu@qs(1spdE!=GJ-Uut6V4Z|D#mOPbQDC_r*u0g^B&63;a)T3Jm}(HGv?-@EOxlpeB4>+;$Ac4EOfZnJkp~xb@=AA%GA^JZGbkI z3J%bwBmVQIx0%{aYmNVU%ZgkbtQO|+JxXiJyNzBR!J>~s4V^+(P*PLLOIXCpPlQh} z9Jupc-tB?v@ot;vuJ)am6#Ea(Old8Lgo)5X!%~-T>JWLKF_~CLukq#zcU!gRNfPT` z8(2*7H?>8C8{HBi;#=69x`s;|TRIV;M$~)OQH1&qW>XE9@(4Q|K)- lpuWKDStZ;5u%FP5QWcgB;KLQ14KAZ;4Xzf; zRF*G$IWuQx#%F&2y3$NbWm@TnHab#YV@;XcXscYe%)DfE#%RU(NFP|wS)DOnGVZ9U zCtQ#9$lagxT5rL8)JUfqVz1BWTm!~KUGm-6XI2co;W@|N7l&-41MZp+_(6M5*h)YY!?wnzC6h!;DP1IFXiEaha ziH`9c^Xyfk;~+Z4=QS15!Ml%hn0Y&hP8=>JYm-WJCy36#C0r?1s(g2Y=!C4KzpAJeD{GCBQ+s_b>h-urAD*0eE4=WeyGjeO(0nLe9} zuJLUD+Zr3jz!cqU>V0K9aPS&oJf5QM57Bbd_7hb30v0Pyo#T0dtuv>`V_1w-?m5q4 zxOVfW>|KIdvNz>>u2;@V!TLMqOw;WQ89isnzg4*N77kIiIif;)M6}J$7H_+oWY2ol zNH_dnZPz)h-g9*OJ02qbSnGsSxTLHWe|c!)^@iJbDvM1+7VQmlIh@|ZA>%t#9f#=p z414tdbsVq0Wn|qh7w^=!jIP(SBH~kK9qQ0lW&3V!b>{o=Axf6Bhu5U{Z#DS`3T9Rz literal 0 HcmV?d00001 diff --git a/windows/theme_onehalflight.reg b/windows/theme_onehalflight.reg new file mode 100644 index 0000000000000000000000000000000000000000..57ff8ed206b1016492c70fee0e36c85a76bdd206 GIT binary patch literal 2124 zcmbuA-EPxB5QXO&iFc^-08yRTangzlR45>zs?wwt0%Rq2QzG&wCl)Oa4}7zZA+9D% z1X^vJ-SwF{Gdn)>^T&-$Wg(d?<(sVKNcwUsckHcYBe^`V^ODmkt0n6rx#m3Qbjo_c zI+CUwGoH#5H$Td2c?;%)ByuK0?Dbh)$bj`wuK3@VPn;-v&F>6*pB?fPYYjPt1GDOvmiw?q6kTs~%w+W^jEmlb7Zp+jj&TYAjc#k>z4nCLOt z?MmqQYs~x5EfXEO8wkKpyuRBedhB?2@ZIyGLlYf>iljqsLoYfq(IZeT@FOhv;_jGe zy$j7+%F~CAO|({RHGSx=iH@k(2=0H&dCx?b-^_%l0}pepXRFp?a-Ow3|4t)=)J z!(DG}f7}7F*}fH*61}h10@zvT3|!1e@$U0&*ILYt>0SG4Ex@+rdjjKXsP9r8-Z-sN z^;CUZp$)2nE41knZ>qPY+CA2qN}-OoH&|Kx7o}C@JwY!oVX;J^ay-w`-E*gsx3Ea0 z-VvU|aOL*Tcy|G6!MiE{XY$HfDL8+}o+_=zkkJu_++{lZm0bJnk@ZmP5uJO1Vys| literal 0 HcmV?d00001 diff --git a/windows/theme_ubuntu.reg b/windows/theme_ubuntu.reg new file mode 100644 index 0000000000000000000000000000000000000000..0aeb1dfa2d99ed006db0e65589b0e446fb0808ea GIT binary patch literal 1796 zcmbW2;ZEBy6ot=kq`d>m15_kUn}%sW5E|RG4WUAZrh%%g4G^ugRniLB!w?$l^keU-XqtH8YpfOXDf5n6 z+M~VEj_W`4QJ=wl*HDKV;IGf@SZB-!I%V9~1r|d$JSX_ObjZl9P8`pf3jK68^Bw6O z8t$BBtbNDVR#$DMO28ZUHgxPo7a+T6HxD6n;zjR)%~6>CgS+iT8!}gqQ*?vesTXbW zur{KFly|)7jHq@%XFNmbt`}{*h2suKE%TyBy5bfydOOJ7^P=spI!KYqdwJ~=oVi`)FG=N4YtincAz=U)(_b` z1vO>wi19=poR=l`FRb0t7x)-c$p(BMOLi`J8e-GuP_g@NQ+6igiuD$!w+cAaJ>PT6 zdq~7{7;f|nhL{*yeZ5A@2;1@nLkre>`l|j}Y$APPcf(qZhOcNCGxkMyT?g#Fj%-9c zO!a~~Tj}=}q-FW4^*qQU7g>wyLy*_%@87)Va8{i41`XR)$HZq-b>VX5*m1AUyQ=5w ie?&n{q8EG?CA+iQ;pU9(k1|K|2|n!K^?y;b6FdQu+Z4zE literal 0 HcmV?d00001 From c57b5a3603f7a72592babf22f366b0c69e5af071 Mon Sep 17 00:00:00 2001 From: Ben Reaves Date: Sat, 4 Apr 2020 21:17:49 -0500 Subject: [PATCH 3/3] - Updated readme to reflect Windows 10 Support --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 4ccba4b..06a90a9 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.