Compare commits

..

2 Commits
1.1-9 ... demo

Author SHA1 Message Date
Ben Reaves
26bc4a203d Merge branch 'master' into demo 2020-06-18 20:37:06 -05:00
Ben Reaves
af2784865b - Demo 2020-06-18 14:11:43 -05:00
7 changed files with 87 additions and 248 deletions

110
README.md
View File

@@ -13,15 +13,11 @@ Seamless copy and paste with all apps and terminals. The zero effort solution.
[What does this do exactly?](#What-does-this-do-exactly) [What does this do exactly?](#What-does-this-do-exactly)
[What's different from other remappers?](#Whats-different)
[What does Kinto require?](#What-does-Kinto-require) [What does Kinto require?](#What-does-Kinto-require)
[How to install (Linux)](#How-to-install-Linux) [How to install](#How-to-install)
[How to install (Windows)](#How-to-install-Windows) [Shortcut Creation (Xkeysnail)](#Shortcut-Creation-Xkeysnail)
[Shortcut Creation](#Shortcut-Creation)
[Other Notes Related to Install](#Other-Notes-Related-to-Install) [Other Notes Related to Install](#Other-Notes-Related-to-Install)
@@ -59,15 +55,9 @@ Kinto works for standard Windows, Apple and Chromebook keyboards. The following
|---|---|---|---|---| |---|---|---|---|---|
|**Virtual**| LCtrl | Alt | RCtrl |Spacebar| |**Virtual**| LCtrl | Alt | RCtrl |Spacebar|
## What's different? Does Kinto have to have specific keymaps for individual apps?
Compared to most other remappers ***this is a complete system-wide remap of your base level modifier keys*** , this saves time. You're not going to die a death of thousand papercuts from trying to support every shortcut key under the sun. I'd say 90+% of the time no, but every OS has their default conventions that sometimes run afoul to macs. For this reason you can easily edit kinto.py or kinto.ahk to support the few shortcut keys Kinto may miss. If you do add additional support please consider forking this project and sharing your new keymaps with the rest of us!
It also retains some of the most commonly used system level shortcut keys, such as Cmd-C/V, Cmd-Tab, and Ctrl-Tab among others. You will keep seamless copy & paste between all apps, ability to switch Windows while still using the physical Cmd/Alt key position; switch tabs in your favorite terminals, code editors, or web browsers. Depending on your OS and/or Desktop Environment you may also be able to switch Virtual Desktop environments the same way as well and other basic system level shortcuts.
If your OS and macOS have similar functionality on the system level, but only differ by a slight difference of a shortcut command then Kinto likely supports it already. If Kinto doesn't have what you need then you can open up a support ticket and it will be added. You can also fork the project to add the fix and I will merge it via a PR you make.
Additionally, if you are using a cross-platform app and if it happens to have a few shortcut keys that differ then that can very easily be added to either the kinto.py or kinto.ahk configuration files which on Windows is located here `~/.kinto/kinto.ahk` and on Linux it can be found here `~/.config/kinto/kinto.py`. More info can be found here [Shortcut Creation (Xkeysnail)](#Shortcut-Creation-Xkeysnail) for Linux.
## What does Kinto require? ## What does Kinto require?
@@ -94,10 +84,11 @@ Wayland support is planned, but not ready yet.
Other programs that will be installed when you run ./setup.py Other programs that will be installed when you run ./setup.py
- Chocolatey - Chocolatey
- Autohotkey - Autohotkey
- Strawberry Perl
Note: Sublime Text users should disable screen rotation hotkeys as they will interfere with multi-cursor and possibly other combos. See https://windowsloop.com/disable-screen-rotation-keyboard-shortcut/ for details. Note: Sublime Text users should disable screen rotation hotkeys as they will interfere with multi-cursor and possibly other combos. See https://windowsloop.com/disable-screen-rotation-keyboard-shortcut/ for details.
Does not have complete parity with the Linux edition, but it is getting very close now. Only lacks some Sublime Text 3 remaps at this point.
Users can now hotswap between Apple and Windows based keyboards without having to logoff and back on, and Windows is currently the only implementation with a system tray (but this feature is coming to Budgie, XFCE, Mate, Gnome, and lastly KDE). Users can now hotswap between Apple and Windows based keyboards without having to logoff and back on, and Windows is currently the only implementation with a system tray (but this feature is coming to Budgie, XFCE, Mate, Gnome, and lastly KDE).
<img src="https://user-images.githubusercontent.com/10969616/84471498-100c7d00-ac4b-11ea-972d-60c1907831ec.png" width="50%"> <img src="https://user-images.githubusercontent.com/10969616/84471498-100c7d00-ac4b-11ea-972d-60c1907831ec.png" width="50%">
@@ -109,7 +100,6 @@ Users can now hotswap between Apple and Windows based keyboards without having t
1. clone this repo 1. clone this repo
``` ```
git clone https://github.com/rbreaves/kinto.git git clone https://github.com/rbreaves/kinto.git
cd kinto
``` ```
2. Install python3 (If needed) 2. Install python3 (If needed)
@@ -134,39 +124,18 @@ To Uninstall Kinto
Video Tutorial: [How to Install Kinto.sh on Windows 10](https://youtu.be/sRk8A8krz40) Video Tutorial: [How to Install Kinto.sh on Windows 10](https://youtu.be/sRk8A8krz40)
1. Open Powershell (Right click and Run as Administrator) Install
2. clone this repo
``` ```
git clone https://github.com/rbreaves/kinto.git python setup.py
cd kinto
```
3. Install - Select keyboard type
```
py setup.py
``` ```
4. How to make Kinto stay visible in system tray (optional) To Uninstall Kinto
<img src="https://user-images.githubusercontent.com/10969616/85195077-2f338c00-b295-11ea-8aa3-e6aa06a9a279.png" width="50%" height="50%">
<img src="https://user-images.githubusercontent.com/10969616/85195079-30fd4f80-b295-11ea-8bcd-257990b77dcb.png" width="50%" height="50%">
<img src="https://user-images.githubusercontent.com/10969616/85195082-322e7c80-b295-11ea-8c81-320dab424c3c.png" width="50%" height="50%">
To Uninstall Kinto - Select Uninstall
``` ```
py setup.py python setup.py
``` ```
## Shortcut Creation
Note: A new project, [Universal Keys](https://github.com/rbreaves/Universal-Keys), has been created that will be updated to contain all current remaps - plus many more. Once that is done, Kinto will be updated to programmatically pull the latest keymaps from simple csv comma delimited files & will build out key remaps from there. This will also allow for more types of remaps within an application category, Sublime Text 3 to VS Code or VS Code to Sublime Text 3, Photoshop to Gimp, Gimp to Photoshop, etc & it will ensure that xkeysnail (linux) & autohotkey (windows) are pulling from the same data set. ## Shortcut Creation (Xkeysnail)
[Linux Shortcut Creation (Xkeysnail)](#Linux-Xkeysnail)
[Windows Shortcut Creation (Autohotkey)](#Windows-Autohotkey)
## Linux (Xkeysnail)
**GUI Keys** **GUI Keys**
| Value| Description|Mac/Kinto Equivalent| | Value| Description|Mac/Kinto Equivalent|
@@ -204,46 +173,6 @@ sudo systemctl restart xkeysnail
More information can be seen on the readme page of [xkeysnail](https://github.com/mooz/xkeysnail). More information can be seen on the readme page of [xkeysnail](https://github.com/mooz/xkeysnail).
## Windows (Autohotkey)
This applies to the Windows version of Kinto and how to add additional support for Applications. The configuration file location is `~/.kinto/kinto.ahk` and after updating it you will want to right click on the tray icon and click on setting your keyboard type again and it will re-apply the latest changes.
Windows 10 has a couple of ways that you need to be aware of when trying to add a specific application, the typical method of how to add any exe program, but then there is also the newer UWP app format that some applications use which will require a similar but different method, both will be discussed.
### Defining Keymaps Per App by EXE Name
You can use the following legend **but** realize that these remaps reference the Virtual keys in the diagrams mentioned near the beginning of this document, so **do not** confuse it with the physical key unless they happen to be the same key.
|Autohotkey Symbol|Virtual key|Description|
|---|---|---|
|^,Ctrl|Control|Primary modifier, 1st rock from the spacebar|
|!,Alt|Alt|Secondary modifier, 2nd rock from the spacebar|
|#,Win|Win/Super|Tertiary modifier, 3rd rock from the spacebar|
```
...
#IfWinActive ahk_exe sublime_text.exe
#^Up::send !{O} ; Switch file
#^f::send {F11} ; toggle_full_screen
^!v::send {Ctrl Down}k{Ctrl Up}{Ctrl Down}v{Ctrl Up} ; paste_from_history
...
#If
...
```
With this being Autohotkey you can easily pull knowledge from the Autohotkey forums for just about any issue you may have as well.
### Defining Keymaps Per UWP App
```
#If WinActive("- OneNote ahk_class ApplicationFrameWindow", "OneNote")
...
; Add your keymaps here
...
#If
```
I don't have too many examples on this one, most developers seem to be shying away from UWP. Kinto currently supports "Fluent Terminal" which is a UWP app, but it is also being grouped with other Terminal apps for hotkey remapping. You may take a look at that, but you may also want to try creating a new Autohotkey file and use the Window Spy feature built into Autohotkey to help you discover the full name and class names of any application.
## Shortcut Creation (XKB) ## Shortcut Creation (XKB)
The older xkb shortcut method info can be read about in ticket [#125](https://github.com/rbreaves/kinto/issues/125). The older xkb shortcut method info can be read about in ticket [#125](https://github.com/rbreaves/kinto/issues/125).
@@ -335,21 +264,6 @@ systemctl --user stop keyswap && setxkbmap -option;setxkbmap -option altwin:swap
## Troubleshooting ## Troubleshooting
### Installed successfully, but modifier keys are not properly remapped?
Are you using a VM on macOS? If so you may need to disable automatic remapping of the Cmd key when using Vmware Fusion of Parallels.
Disable Parallels Re-mapping:
1) Open Parallels and go to Preferences.
2) Click Keyboard and disable the Virtual machine shortcuts.
3) Close Preferences.
To disable keyboard mapping:
1) From Fusion's menu bar, click VMware Fusion > Preferences...
2) Click Keyboard & Mouse.
3) Click the Key Mappings tab.
4) Deselect Enable Key Mapping.
### Does not start when you log in or after you reboot? ### Does not start when you log in or after you reboot?
Kinto (xkb/x11) = keyswap Kinto (xkb/x11) = keyswap
@@ -425,7 +339,7 @@ cd ~/.config/kinto
./kintox11 ./kintox11
``` ```
## Debug (Linux - xkb method only) ## Debug
If all else fails you can now run Kinto in debug mode as of 1.0.6-2. The output will become more verbose and I'd recommend running this directly after stopping the service. If all else fails you can now run Kinto in debug mode as of 1.0.6-2. The output will become more verbose and I'd recommend running this directly after stopping the service.

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import json, time, os, sys, subprocess, shlex, platform import json, time, os, sys, subprocess, shlex
from shutil import copyfile from shutil import copyfile
from subprocess import PIPE, Popen from subprocess import PIPE, Popen
from prekinto import * from prekinto import *
@@ -16,35 +16,32 @@ def windows_setup():
print("") print("")
# Short DOS path notation # Short DOS path notation
path= cmdline('echo %cd%')[:-1] path= cmdline('echo %cd%')[:-1]
print("Copying autohotkey combinations for Terminals & Editors...")
os.system("copy /Y " + path + "\\windows\\kinto.ahk " + path + "\\windows\\kinto-new.ahk")
if default == 1:
os.system('perl -pi -e "s/(; )(.*)(; MacModifiers)/$2$3/g" ./windows/kinto-new.ahk')
# os.system("regedit " + path + "\\windows\\macbook_winctrl_swap.reg")
elif default == 2:
os.system('perl -pi -e "s/(; )(.*)(; WinModifiers)/$2$3/g" ./windows/kinto-new.ahk')
# os.system("regedit " + path + "\\windows\\standard_ctrlalt_swap.reg")
elif default == 3:
os.system("regedit " + path + "\\windows\\remove_keyswap.reg")
os.system("del /f .\\windows\\kinto-new.ahk")
os.system("del \"C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp\\kinto.ahk\"")
os.system("taskkill /IM autohotkey.exe")
os.system('rd /s /q %userprofile%\\.kinto')
os.system('del "%userprofile%\\AppData\\Roaming\\Microsoft\\Windows\\STARTM~1\\Programs\\Startup\\kinto-start.vbs"')
stvscode = yn_choice(bcolors.CYELLOW2 + "Would you like to use Sublime Text 3 keymaps in VS Code?\n" + bcolors.ENDC)
if default > 0 and default < 3: if default > 0 and default < 3:
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"')
print("Copying autohotkey combinations for Terminals & Editors...") os.system('refreshenv')
os.system("copy /Y " + path + "\\windows\\kinto.ahk " + path + "\\windows\\kinto-new.ahk")
if default == 1:
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; MacModifiers)/$2$3/g" .\\windows\\kinto-new.ahk')
elif default == 2:
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; WinModifiers)/$2$3/g" .\\windows\\kinto-new.ahk')
elif default == 3:
print("Removing any old registry keys from prior versions...")
p = subprocess.Popen(['powershell.exe', "Remove-ItemProperty -Path HKLM:'SYSTEM\CurrentControlSet\Control\Keyboard Layout' -Name 'Scancode Map' -ErrorAction SilentlyContinue"], stdout=sys.stdout)
print("Removing Kinto from Startup folder...")
os.system("(del \"C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp\\kinto.ahk\") 2> nul")
os.system('(del "%userprofile%\\AppData\\Roaming\\Microsoft\\Windows\\STARTM~1\\Programs\\Startup\\kinto-start.vbs") 2> nul')
print("Ending any running Kinto tasks...")
os.system("(taskkill /IM autohotkey.exe) 2> nul")
print("Removing Kinto from users profile directory...")
os.system('(rd /s /q %userprofile%\\.kinto) 2> nul')
print("")
print("Uninstall of Kinto is Complete.")
if default > 0 and default < 3:
stvscode = yn_choice(bcolors.CYELLOW2 + "Would you like to use Sublime Text 3 keymaps in VS Code?\n" + bcolors.ENDC)
print("\nWill now install Ubuntu Termimnal Theme as default...") print("\nWill now install Ubuntu Termimnal Theme as default...")
os.system("regedit " + path + "\\windows\\theme_ubuntu.reg") os.system("regedit " + path + "\\windows\\theme_ubuntu.reg")
os.system('robocopy '+ path + '\\assets "%userprofile%\\.kinto\\assets" /E') os.system('robocopy '+ path + '\\assets "%userprofile%\\.kinto\\assets" /E')
if(stvscode): if(stvscode):
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; ST2CODE)/$2$3/g" .\\windows\\kinto-new.ahk') os.system('perl -pi -e "s/(; )(.*)(; ST2CODE)/$2$3/g" ./windows/kinto-new.ahk')
os.system('copy /Y ' + path + '\\windows\\kinto-start.vbs "%userprofile%\\.kinto\\kinto-start.vbs') os.system('copy /Y ' + path + '\\windows\\kinto-start.vbs "%userprofile%\\.kinto\\kinto-start.vbs')
os.system('copy /Y ' + path + '\\windows\\usb.vbs "%userprofile%\\.kinto\\usb.vbs"') os.system('copy /Y ' + path + '\\windows\\usb.vbs "%userprofile%\\.kinto\\usb.vbs"')
os.system('copy /Y ' + path + '\\windows\\detectUSB.ahk "%userprofile%\\.kinto\\detectUSB.ahk"') os.system('copy /Y ' + path + '\\windows\\detectUSB.ahk "%userprofile%\\.kinto\\detectUSB.ahk"')
@@ -53,13 +50,13 @@ def windows_setup():
os.system('copy /Y '+ path + '\\windows\\toggle_kb.bat "%userprofile%\\.kinto\\toggle_kb.bat"') os.system('copy /Y '+ path + '\\windows\\toggle_kb.bat "%userprofile%\\.kinto\\toggle_kb.bat"')
os.system('copy /Y '+ path + '\\windows\\kinto-new.ahk "%userprofile%\\.kinto\\kinto.ahk"') os.system('copy /Y '+ path + '\\windows\\kinto-new.ahk "%userprofile%\\.kinto\\kinto.ahk"')
os.system("del /f .\\windows\\kinto-new.ahk") os.system("del /f .\\windows\\kinto-new.ahk")
os.system("del \"C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp\\kinto.ahk\" 2> nul") os.system("del \"C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp\\kinto.ahk\"")
os.system("%userprofile%\\AppData\\Roaming\\Microsoft\\Windows\\STARTM~1\\Programs\\Startup\\kinto-start.vbs") os.system("%userprofile%\\AppData\\Roaming\\Microsoft\\Windows\\STARTM~1\\Programs\\Startup\\kinto-start.vbs")
# # 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: else:
os.system("(del \"C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp\\kinto.ahk\") 2> nul") os.system("del \"C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp\\kinto.ahk\"")
def cmdline(command): def cmdline(command):
process = Popen( process = Popen(
@@ -70,11 +67,7 @@ def cmdline(command):
) )
return process.communicate()[0] return process.communicate()[0]
if platform.system() == 'Windows': # check_x11 = cmdline("env | grep -i x11").strip()
print("\nYou are detected as running Windows.")
windows_setup()
sys.exit()
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:

View File

@@ -1,22 +1,15 @@
if(-not(Get-Command "choco" -errorAction SilentlyContinue)){ $testchoco = powershell choco -v
if(-not($testchoco)){
Write-Output "Seems Chocolatey is not installed, installing now" 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')) Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
refreshenv
} }
else{ else{
Write-Output "Chocolatey is already installed" Write-Output "Chocolatey Version $testchoco is already installed"
} }
if(-not(test-path "C:\Program Files\AutoHotkey\AutoHotkey.exe")){ if(-not(test-path "C:\Program Files\AutoHotkey\AutoHotkey.exe")){
choco install autohotkey.install choco install autohotkey.install
} }
else{
Write-Output "Autohotkey is already installed"
}
if(-not(test-path "C:\Strawberry\")){ if(-not(test-path "C:\Strawberry\")){
choco install strawberryperl choco install strawberryperl
refreshenv
}
else{
Write-Output "Perl is already installed"
} }

View File

@@ -5,6 +5,8 @@
DetectHiddenWindows, On DetectHiddenWindows, On
Run, %A_ScriptDir%\detectUSB.ahk Run, %A_ScriptDir%\detectUSB.ahk
Run, C:\Users\%A_UserName%\.keypressosd\KeypressOSD_kinto.ahk
; I_Icon = %A_ScriptDir%\assets\kinto-white.ico ; MacModifiers ; I_Icon = %A_ScriptDir%\assets\kinto-white.ico ; MacModifiers
; IfExist, %I_Icon% ; MacModifiers ; IfExist, %I_Icon% ; MacModifiers
; Menu, Tray, Icon, %I_Icon%,, 1 ; MacModifiers ; Menu, Tray, Icon, %I_Icon%,, 1 ; MacModifiers
@@ -48,6 +50,9 @@ tray_suspend(){
Menu, Tray, Tip, Suspended - Kinto Menu, Tray, Tip, Suspended - Kinto
IfWinExist, detectUSB.ahk IfWinExist, detectUSB.ahk
WinClose WinClose
IfWinExist, KeypressOSD_kinto.ahk
WinClose
Run, C:\Users\%A_UserName%\.keypressosd\KeypressOSD.ahk
} }
else{ else{
menu, tray, unCheck, Suspend Kinto menu, tray, unCheck, Suspend Kinto
@@ -55,6 +60,9 @@ tray_suspend(){
; I_Icon = %A_ScriptDir%\assets\kinto-white-invert.ico ; WinModifiers ; I_Icon = %A_ScriptDir%\assets\kinto-white-invert.ico ; WinModifiers
Menu, Tray, Icon, %I_Icon%,,1 Menu, Tray, Icon, %I_Icon%,,1
Run, %A_ScriptDir%\detectUSB.ahk Run, %A_ScriptDir%\detectUSB.ahk
IfWinExist, KeypressOSD.ahk
WinClose
Run, C:\Users\%A_UserName%\.keypressosd\KeypressOSD_kinto.ahk
} }
; Refocus last active Window ; Refocus last active Window
Send {LAlt down}{tab}{LAlt up} Send {LAlt down}{tab}{LAlt up}
@@ -63,7 +71,11 @@ tray_suspend(){
Exit() { Exit() {
IfWinExist, detectUSB.ahk IfWinExist, detectUSB.ahk
WinClose WinClose
IfWinExist, KeypressOSD.ahk
WinClose, C:\Users\%A_UserName%\.keypressosd\KeypressOSD.ahk ahk_class AutoHotkey
IfWinExist, KeypressOSD_kinto.ahk
WinClose, C:\Users\%A_UserName%\.keypressosd\KeypressOSD_kinto.ahk ahk_class AutoHotkey
ExitApp ExitApp
} }
@@ -75,7 +87,6 @@ GroupAdd, terminals, ahk_exe ConEmu64.exe
GroupAdd, terminals, ahk_exe powershell.exe GroupAdd, terminals, ahk_exe powershell.exe
GroupAdd, terminals, ahk_exe WindowsTerminal.exe GroupAdd, terminals, ahk_exe WindowsTerminal.exe
GroupAdd, terminals, ahk_exe Hyper.exe GroupAdd, terminals, ahk_exe Hyper.exe
GroupAdd, terminals, ahk_exe mintty.exe
GroupAdd, terminals, ahk_exe Cmd.exe GroupAdd, terminals, ahk_exe Cmd.exe
GroupAdd, terminals, ahk_exe Terminus.exe GroupAdd, terminals, ahk_exe Terminus.exe
GroupAdd, terminals, Fluent Terminal ahk_class ApplicationFrameWindow GroupAdd, terminals, Fluent Terminal ahk_class ApplicationFrameWindow
@@ -96,12 +107,6 @@ GroupAdd, editors, ahk_exe sublime_text.exe
GroupAdd, editors, ahk_exe VSCodium.exe GroupAdd, editors, ahk_exe VSCodium.exe
GroupAdd, editors, ahk_exe Code.exe GroupAdd, editors, ahk_exe Code.exe
GroupAdd, browsers, ahk_exe chrome.exe
GroupAdd, browsers, ahk_exe opera.exe
GroupAdd, browsers, ahk_exe firefox.exe
; Disabled Edge for now - no ability to close all instances
; GroupAdd, browsers, Microsoft Edge ahk_class ApplicationFrameWindow
GroupAdd, vscode, ahk_exe VSCodium.exe GroupAdd, vscode, ahk_exe VSCodium.exe
GroupAdd, vscode, ahk_exe Code.exe GroupAdd, vscode, ahk_exe Code.exe
@@ -208,11 +213,6 @@ $^+Right::Send +{End}
; Cmd+Space Alternative ; Cmd+Space Alternative
^Space::Send ^{Esc} ^Space::Send ^{Esc}
; Close all browsers
#IfWinActive ahk_group browsers
^q::send {Alt Down}f{Alt Up}x ; exit all windows
#If
; Sublime Text Remaps for VS Code ; Sublime Text Remaps for VS Code
#IfWinActive ahk_group vscode #IfWinActive ahk_group vscode
; Remap Ctrl+Shift to behave like macOS Sublimetext ; Remap Ctrl+Shift to behave like macOS Sublimetext
@@ -225,60 +225,13 @@ $^+Right::Send +{End}
#If #If
#IfWinActive ahk_exe sublime_text.exe #IfWinActive ahk_exe sublime_text.exe
#^Up::send !{O} ; Switch file ; Remap Ctrl+Shift to behave like macOS Sublimetext
#^f::send {F11} ; toggle_full_screen ; Will extend cursor to multiple lines
^!v::send {Ctrl Down}k{Ctrl Up}{Ctrl Down}v{Ctrl Up} ; paste_from_history #+Up::send {shift up}^!{Up}
^Up::Return ; cancel scroll_lines up #+Down::send {shift up}^!{Down}
^!Up::send ^{Up} ; scroll_lines up
^Down::Return ; cancel scroll_lines down ; Remap Ctrl+Cmd+G to select all matches
^!Down::send ^{Down} ; scroll_lines down #^g::send !{F3}
#+Up::send {shift up}^!{Up} ; multi-cursor up
#+Down::send {shift up}^!{Down} ; multi-cursor down
^PgDn::Return ; cancel next_view
^PgUp::Return ; cancel prev_view
^+{::send ^{PgDn} ; next_view
^+}::send ^{PgUp} ; prev_view
^!Right::send ^{PgDn} ; next_view
^!Left::send ^{PgUp} ; prev_view
Insert::Return ; cancel toggle_overwrite
^!O::send {Insert} ; toggle_overwrite
!c::Return ; cancel toggle_case_sensitive
^!c::send !{c} ; toggle_case_sensitive
^h::Return ; cancel replace
^!f::send ^{h} ; replace
^+h::Return ; cancel replace_next
^!e::send ^+{h} ; replace_next
F3::Return ; cancel find_next
^g::send {F3} ; find_next
*F3::Return ; cancel find_prev, find_under, find_all_under
^+g::send +{F3} ; find_prev
#!g::send ^{F3} ; find_under
#!+g::send ^+{F3} ; find_under_prev
#^g::send !{F3} ; find_all_under
^+Up::Return ; cancel swap_line_up
#!Up::send ^+{Up} ; swap_line_up
^+Down::Return ; cancel swap_line_down
#!Down::send ^+{Down} ; swap_line_down
^Pause::Return ; cancel cancel_build
#c::send ^{Pause} ; cancel_build
F9::Return ; cancel sort_lines case_s false
F5::send {F9} ; sort_lines case_s false
#F9::Return ; cancel sort_lines case_s true
#F5::send #{F9} ; sort_lines case_s true
!+1::Return ; cancel set_layout
^!1::send !+1 ; set_layout
!+2::Return ; cancel set_layout
^!2::send !+2 ; set_layout
!+3::Return ; cancel set_layout
^!3::send !+3 ; set_layout
!+4::Return ; cancel set_layout
^!4::send !+4 ; set_layout
!+5::Return ; cancel set_layout
^!5::send !+5 ; set_layout
!+8::Return ; cancel set_layout
^!8::send !+8 ; set_layout
!+9::Return ; cancel set_layout
^!9::send !+9 ; set_layout
#If #If
#IfWinActive ahk_group terminals #IfWinActive ahk_group terminals
@@ -298,10 +251,7 @@ $^+Right::Send +{End}
; Paste ; Paste
^v:: ^v::
If WinActive("ahk_exe mintty.exe"){ If WinActive("ahk_group posix"){
Send {Shift down}{Insert}{Shift up}
}
else if WinActive("ahk_group posix"){
Send {Blind}{Shift down}v{Shift up} Send {Blind}{Shift down}v{Shift up}
} }
else{ else{

View File

@@ -7,14 +7,14 @@ echo Not found.
goto commonexit goto commonexit
:win :win
C:\Strawberry\perl\bin\perl.exe -pi -e "s/(; )(.*)(; WinModifiers)/$2$3/g" "%userprofile%\.kinto\kinto.ahk" perl -pi -e "s/(; )(.*)(; WinModifiers)/$2$3/g" "%userprofile%\.kinto\kinto.ahk"
C:\Strawberry\perl\bin\perl.exe -pi -e "s/^(?!;)(.*)(; MacModifiers)/; $1$2/gm" "%userprofile%\.kinto\kinto.ahk" perl -pi -e "s/^(?!;)(.*)(; MacModifiers)/; $1$2/gm" "%userprofile%\.kinto\kinto.ahk"
"C:\Program Files\AutoHotkey\AutoHotkey.exe" "%userprofile%\.kinto\kinto.ahk" "C:\Program Files\AutoHotkey\AutoHotkey.exe" "%userprofile%\.kinto\kinto.ahk"
goto commonexit goto commonexit
:mac :mac
C:\Strawberry\perl\bin\perl.exe -pi -e "s/(; )(.*)(; MacModifiers)/$2$3/g" "%userprofile%\.kinto\kinto.ahk" perl -pi -e "s/(; )(.*)(; MacModifiers)/$2$3/g" "%userprofile%\.kinto\kinto.ahk"
C:\Strawberry\perl\bin\perl.exe -pi -e "s/^(?!;)(.*)(; WinModifiers)/; $1$2/gm" "%userprofile%\.kinto\kinto.ahk" perl -pi -e "s/^(?!;)(.*)(; WinModifiers)/; $1$2/gm" "%userprofile%\.kinto\kinto.ahk"
"C:\Program Files\AutoHotkey\AutoHotkey.exe" "%userprofile%\.kinto\kinto.ahk" "C:\Program Files\AutoHotkey\AutoHotkey.exe" "%userprofile%\.kinto\kinto.ahk"
goto commonexit goto commonexit

View File

@@ -10,11 +10,6 @@ terminals = ["gnome-terminal","konsole","io.elementary.terminal","terminator","s
terminals = [term.casefold() for term in terminals] terminals = [term.casefold() for term in terminals]
termStr = "|".join(str(x) for x in terminals) termStr = "|".join(str(x) for x in terminals)
# Use for browser specific hotkeys
browsers = ["Chromium","Chromium-browser","Google-chrome","Epiphany","Firefox","Discord"]
browsers = [browser.casefold() for browser in browsers]
browserStr = "|".join(str(x) for x in browsers)
mscodes = ["code","vscodium"] mscodes = ["code","vscodium"]
codeStr = "|".join(str(x) for x in mscodes) codeStr = "|".join(str(x) for x in mscodes)
@@ -23,22 +18,22 @@ define_conditional_modmap(lambda wm_class: wm_class.casefold() not in terminals,
# # Chromebook # # Chromebook
# Key.LEFT_ALT: Key.RIGHT_CTRL, # Chromebook # Key.LEFT_ALT: Key.RIGHT_CTRL, # Chromebook
# Key.LEFT_CTRL: Key.LEFT_ALT, # Chromebook # Key.LEFT_CTRL: Key.LEFT_ALT, # Chromebook
# Key.RIGHT_ALT: Key.RIGHT_CTRL, # Chromebook - Multi-language (Remove) # Key.RIGHT_ALT: Key.RIGHT_CTRL, # Chromebook
# Key.RIGHT_CTRL: Key.RIGHT_ALT, # Chromebook - Multi-language (Remove) # Key.RIGHT_CTRL: Key.RIGHT_ALT, # Chromebook
# # Default Mac/Win # # Default Mac/Win
# Key.LEFT_ALT: Key.RIGHT_CTRL, # WinMac # Key.LEFT_ALT: Key.RIGHT_CTRL, # WinMac
# Key.LEFT_META: Key.LEFT_ALT, # WinMac # Key.LEFT_META: Key.LEFT_ALT, # WinMac
# Key.LEFT_CTRL: Key.LEFT_META, # WinMac # Key.LEFT_CTRL: Key.LEFT_META, # WinMac
# Key.RIGHT_ALT: Key.RIGHT_CTRL, # WinMac - Multi-language (Remove) # Key.RIGHT_ALT: Key.RIGHT_CTRL, # WinMac
# Key.RIGHT_META: Key.RIGHT_ALT, # WinMac - Multi-language (Remove) # Key.RIGHT_META: Key.RIGHT_ALT, # WinMac
# Key.RIGHT_CTRL: Key.RIGHT_META, # WinMac - Multi-language (Remove) # Key.RIGHT_CTRL: Key.RIGHT_META, # WinMac
# # Mac Only # # Mac Only
# Key.LEFT_META: Key.RIGHT_CTRL, # Mac # Key.LEFT_META: Key.RIGHT_CTRL, # Mac
# Key.LEFT_CTRL: Key.LEFT_META, # Mac # Key.LEFT_CTRL: Key.LEFT_META, # Mac
# Key.RIGHT_META: Key.RIGHT_CTRL, # Mac - Multi-language (Remove) # Key.RIGHT_META: Key.RIGHT_CTRL, # Mac
# Key.RIGHT_CTRL: Key.RIGHT_META, # Mac - Multi-language (Remove) # Key.RIGHT_CTRL: Key.RIGHT_META, # Mac
}) })
# [Conditional modmap] Change modifier keys in certain applications # [Conditional modmap] Change modifier keys in certain applications
@@ -56,14 +51,14 @@ define_conditional_modmap(re.compile(termStr, re.IGNORECASE), {
# Key.LEFT_META: Key.LEFT_ALT, # WinMac # Key.LEFT_META: Key.LEFT_ALT, # WinMac
# Key.LEFT_CTRL: Key.LEFT_CTRL, # WinMac # Key.LEFT_CTRL: Key.LEFT_CTRL, # WinMac
# Key.RIGHT_ALT: Key.RIGHT_CTRL, # WinMac - Multi-language (Remove) # Key.RIGHT_ALT: Key.RIGHT_CTRL, # WinMac - Multi-language (Remove)
# Key.RIGHT_META: Key.RIGHT_ALT, # WinMac - Multi-language (Remove) # Key.RIGHT_META: Key.RIGHT_ALT, # WinMac
# Key.RIGHT_CTRL: Key.LEFT_CTRL, # WinMac - Multi-language (Remove) # Key.RIGHT_CTRL: Key.LEFT_CTRL, # WinMac
# # Mac Only # # Mac Only
# Key.LEFT_META: Key.RIGHT_CTRL, # Mac # Key.LEFT_META: Key.RIGHT_CTRL, # Mac
# # Left Ctrl Stays Left Ctrl # # Left Ctrl Stays Left Ctrl
# Key.RIGHT_META: Key.RIGHT_CTRL, # Mac - Multi-language (Remove) # Key.RIGHT_META: Key.RIGHT_CTRL, # Mac
# Key.RIGHT_CTRL: Key.LEFT_CTRL, # Mac - Multi-language (Remove) # Key.RIGHT_CTRL: Key.LEFT_CTRL, # Mac
}) })
# Keybindings for Nautilus # Keybindings for Nautilus
@@ -74,11 +69,6 @@ define_keymap(re.compile("org.gnome.nautilus", re.IGNORECASE),{
K("RC-Right"): K("M-Right"), # Go Forward K("RC-Right"): K("M-Right"), # Go Forward
}) })
# Keybindings for Browsers
define_keymap(re.compile(browserStr, re.IGNORECASE),{
K("RC-Q"): K("RC-Q"), # Close all browsers Instances
})
define_keymap(None,{ define_keymap(None,{
# Basic App hotkey functions # Basic App hotkey functions
K("RC-Q"): K("Alt-F4"), K("RC-Q"): K("Alt-F4"),
@@ -185,9 +175,9 @@ define_keymap(re.compile("Sublime_text", re.IGNORECASE),{
K("Super-RC-f"): K("f11"), # toggle_full_screen K("Super-RC-f"): K("f11"), # toggle_full_screen
K("C-M-v"): [K("C-k"), K("C-v")], # paste_from_history K("C-M-v"): [K("C-k"), K("C-v")], # paste_from_history
K("C-up"): pass_through_key, # cancel scroll_lines up K("C-up"): pass_through_key, # cancel scroll_lines up
K("C-M-up"): K("C-up"), # scroll_lines up K("Super-M-up"): K("C-up"), # scroll_lines up
K("C-down"): pass_through_key, # cancel scroll_lines down K("C-down"): pass_through_key, # cancel scroll_lines down
K("C-M-down"): K("C-down"), # scroll_lines down K("Super-M-down"): K("C-down"), # scroll_lines down
K("Super-Shift-up"): K("M-Shift-up"), # multi-cursor up K("Super-Shift-up"): K("M-Shift-up"), # multi-cursor up
K("Super-Shift-down"): K("M-Shift-down"), # multi-cursor down K("Super-Shift-down"): K("M-Shift-down"), # multi-cursor down
K("C-PAGE_DOWN"): pass_through_key, # cancel next_view K("C-PAGE_DOWN"): pass_through_key, # cancel next_view
@@ -217,9 +207,9 @@ define_keymap(re.compile("Sublime_text", re.IGNORECASE),{
# K("M-C-g"): K("M-Refresh"), # Chromebook - find_all_under # K("M-C-g"): K("M-Refresh"), # Chromebook - find_all_under
K("Super-C-g"): K("M-f3"), # Default - find_all_under K("Super-C-g"): K("M-f3"), # Default - find_all_under
K("C-Shift-up"): pass_through_key, # cancel swap_line_up K("C-Shift-up"): pass_through_key, # cancel swap_line_up
K("Super-M-up"): K("C-Shift-up"), # swap_line_up K("Super-C-up"): K("C-Shift-up"), # swap_line_up
K("C-Shift-down"): pass_through_key, # cancel swap_line_down K("C-Shift-down"): pass_through_key, # cancel swap_line_down
K("Super-M-down"): K("C-Shift-down"), # swap_line_down K("Super-C-down"): K("C-Shift-down"), # swap_line_down
K("C-Pause"): pass_through_key, # cancel cancel_build K("C-Pause"): pass_through_key, # cancel cancel_build
K("Super-c"): K("C-Pause"), # cancel_build K("Super-c"): K("C-Pause"), # cancel_build
K("f9"): pass_through_key, # cancel sort_lines case_s false K("f9"): pass_through_key, # cancel sort_lines case_s false

View File

@@ -75,13 +75,13 @@ function uninstall {
function removeAppleKB { function removeAppleKB {
# Undo Apple keyboard cmd & alt swap # Undo Apple keyboard cmd & alt swap
if test -f "/sys/module/hid_apple/parameters/swap_opt_cmd" && [ `cat /sys/module/hid_apple/parameters/swap_opt_cmd` == "1" ]; then if test -f "/sys/module/hid_apple/parameters/swap_opt_cmd" && [ `cat /sys/module/hid_apple/parameters/swap_opt_cmd` == "1" ]; then
echo '0' | sudo tee /sys/module/hid_apple/parameters/swap_opt_cmd echo '0' | sudo tee -a /sys/module/hid_apple/parameters/swap_opt_cmd
echo 'options hid_apple swap_opt_cmd=0' | sudo tee /etc/modprobe.d/hid_apple.conf echo 'options hid_apple swap_opt_cmd=0' | sudo tee -a /etc/modprobe.d/hid_apple.conf
sudo update-initramfs -u -k all sudo update-initramfs -u -k all
fi fi
if test -f "/sys/module/applespi/parameters/swap_opt_cmd" && [ `cat /sys/module/applespi/parameters/swap_opt_cmd` == "1" ]; then if test -f "/sys/module/applespi/parameters/swap_opt_cmd" && [ `cat /sys/module/applespi/parameters/swap_opt_cmd` == "1" ]; then
echo '0' | sudo tee /sys/module/applespi/parameters/swap_opt_cmd echo '0' | sudo tee -a /sys/module/applespi/parameters/swap_opt_cmd
echo 'options applespi swap_opt_cmd=0' | sudo tee /etc/modprobe.d/applespi.conf echo 'options applespi swap_opt_cmd=0' | sudo tee -a /etc/modprobe.d/applespi.conf
sudo update-initramfs -u -k all sudo update-initramfs -u -k all
fi fi
} }
@@ -151,9 +151,9 @@ function budgieUpdate {
if [ $# -eq 0 ]; then if [ $# -eq 0 ]; then
echo "Install Kinto - xkeysnail (udev)" echo "Install Kinto - xkeysnail (udev)"
echo " 1) Windows & Mac (HID driver) - Most Standard keyboards (& 1st party usb/bt Apple keyboards)" echo " 1) Windows & Mac (HID driver)"
echo " 2) Mac Only & VMs on Macbooks - 3rd & 1st party Apple keyboards" echo " 2) Mac Only & VMs on Macbooks"
echo " 3) Chromebook - Chromebook running Linux" echo " 3) Chromebook"
# echo " 5) Uninstall" # echo " 5) Uninstall"
read n read n
@@ -168,7 +168,7 @@ vssublime=false
if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "winmac" || $1 == "mac" || $1 == "chromebook" ]]; then if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "winmac" || $1 == "mac" || $1 == "chromebook" ]]; then
while true; do while true; do
read -rep $'\nDo you want multi-language on Right Alt key? (y/N)\naka Left side remaps, right side doesn\'t\n' yn read -rep $'\nDo you want multi-language support (the right Alt key will not remap)? (y/N)\n' yn
case $yn in case $yn in
[Yy]* ) rightalt=true; break;; [Yy]* ) rightalt=true; break;;
* ) break;; * ) break;;
@@ -234,7 +234,6 @@ if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "winmac" || $1 == "mac" || $1
chmod +x ~/.kde/Autostart/kintohost.sh chmod +x ~/.kde/Autostart/kintohost.sh
# KDE startup - xhost fix # KDE startup - xhost fix
mkdir -p ~/.config/autostart
yes | cp -rf ./xkeysnail-config/xkeysnail.desktop ~/.config/autostart/xkeysnail.desktop yes | cp -rf ./xkeysnail-config/xkeysnail.desktop ~/.config/autostart/xkeysnail.desktop
yes | cp -rf ./xkeysnail-config/xkeystart.sh ~/.config/kinto/xkeystart.sh yes | cp -rf ./xkeysnail-config/xkeystart.sh ~/.config/kinto/xkeystart.sh
@@ -271,10 +270,10 @@ fi
if [[ $1 == "1" || $1 == "winmac" ]]; then if [[ $1 == "1" || $1 == "winmac" ]]; then
if ls /sys/module | grep hid_apple >/dev/null 2>&1 ; then if ls /sys/module | grep hid_apple >/dev/null 2>&1 ; then
echo '1' | sudo tee /sys/module/hid_apple/parameters/swap_opt_cmd;echo 'options hid_apple swap_opt_cmd=1' | sudo tee /etc/modprobe.d/hid_apple.conf;sudo update-initramfs -u -k all echo '1' | sudo tee -a /sys/module/hid_apple/parameters/swap_opt_cmd;echo 'options hid_apple swap_opt_cmd=1' | sudo tee -a /etc/modprobe.d/hid_apple.conf;sudo update-initramfs -u -k all
fi fi
if ls /sys/module | grep applespi >/dev/null 2>&1 ; then if ls /sys/module | grep applespi >/dev/null 2>&1 ; then
echo '1' | sudo tee /sys/module/applespi/parameters/swap_opt_cmd;echo 'options applespi swap_opt_cmd=1' | sudo tee /etc/modprobe.d/applespi.conf;sudo update-initramfs -u -k all echo '1' | sudo tee -a /sys/module/applespi/parameters/swap_opt_cmd;echo 'options applespi swap_opt_cmd=1' | sudo tee -a /etc/modprobe.d/applespi.conf;sudo update-initramfs -u -k all
fi fi
if ! ls /sys/module | grep apple ; then if ! ls /sys/module | grep apple ; then
removeAppleKB removeAppleKB