mirror of
https://github.com/rbreaves/kinto.git
synced 2025-08-02 09:06:40 +02:00
- Merged hotfix to dev
This commit is contained in:
24
README.md
24
README.md
@@ -1,6 +1,6 @@
|
||||
# Kinto
|
||||
# Kinto.sh
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
[](https://github.com/rbreaves/kinto/releases/latest)
|
||||
@@ -14,6 +14,8 @@ System tray supports the following, but Kinto can run without it on Linux.
|
||||
|---|---|
|
||||
|<img src="https://user-images.githubusercontent.com/10969616/89241619-15d86c00-d5c5-11ea-8ffe-18ee6ca0f895.png" width="50%">|<img src="https://user-images.githubusercontent.com/10969616/84471501-10a51380-ac4b-11ea-9e0e-c19a7ebfad6d.png" width="50%">|
|
||||
|
||||
Note: This project does a lot more than just copy & paste for terminals. I really do mean type like a mac and additions can easily be added to a single file, kinto.py/ahk.
|
||||
|
||||
## Table of Contents
|
||||
|
||||
[What does this do exactly?](#What-does-this-do-exactly)
|
||||
@@ -64,6 +66,8 @@ Kinto works for standard Windows, Apple and Chromebook keyboards. The following
|
||||
|---|---|---|---|---|
|
||||
|**Virtual**| LCtrl | Alt | RCtrl |Spacebar|
|
||||
|
||||
Note: RCtrl for terminals is also adding in Shift most of the time, however it depends on the specific terminal in use and will change itself to the expected keymaps of that terminal application.
|
||||
|
||||
## What's different?
|
||||
|
||||
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 a thousand papercuts from trying to support every shortcut key under the sun.
|
||||
@@ -291,44 +295,44 @@ git pull origin master
|
||||
|
||||
Under systemd this is how you control Kinto.
|
||||
|
||||
Kinto (xkb/x11) = keyswap
|
||||
Recommended Install - Kinto (udev/xkeysnail/x11) = xkeysnail
|
||||
|
||||
Kinto (udev/xkeysnail/x11) = xkeysnail
|
||||
Older Install - Kinto (xkb/x11) = keyswap
|
||||
|
||||
Status
|
||||
```
|
||||
systemctl --user status keyswap
|
||||
sudo systemctl status xkeysnail
|
||||
systemctl --user status keyswap # older - you probably should not run this one
|
||||
```
|
||||
|
||||
Stop (your keymap will return to normal)
|
||||
```
|
||||
systemctl --user stop keyswap
|
||||
sudo systemctl stop xkeysnail
|
||||
systemctl --user stop keyswap # older - you probably should not run this one
|
||||
```
|
||||
|
||||
Start
|
||||
```
|
||||
systemctl --user start keyswap
|
||||
sudo systemctl start xkeysnail
|
||||
systemctl --user start keyswap # older - you probably should not run this one
|
||||
```
|
||||
|
||||
Restart
|
||||
```
|
||||
systemctl --user restart keyswap
|
||||
sudo systemctl restart xkeysnail
|
||||
systemctl --user restart keyswap # older - you probably should not run this one
|
||||
```
|
||||
|
||||
Enable
|
||||
```
|
||||
systemctl --user enable keyswap
|
||||
sudo systemctl enable xkeysnail
|
||||
systemctl --user enable keyswap # older - you probably should not run this one
|
||||
```
|
||||
|
||||
Disable
|
||||
```
|
||||
systemctl --user disable keyswap
|
||||
sudo systemctl disable xkeysnail
|
||||
systemctl --user disable keyswap # older - you probably should not run this one
|
||||
```
|
||||
|
||||
## Learning macOS style hotkeys on Linux
|
||||
|
22
setup.py
22
setup.py
@@ -150,7 +150,8 @@ def setShortcuts():
|
||||
# Too slow on appearing, compared to the app menu
|
||||
#
|
||||
# if dename != "budgie":
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings panel-main-menu \"['<Primary><Shift>Space','<Primary>Space']\"")
|
||||
cmdline("gsettings reset org.gnome.desktop.wm.keybindings panel-main-menu")
|
||||
# cmdline("gsettings set org.gnome.desktop.wm.keybindings panel-main-menu \"['<Primary><Shift>Space','<Primary>Space']\"")
|
||||
# else:
|
||||
# cmdline("gsettings set org.gnome.desktop.wm.keybindings panel-main-menu \"['<Alt>F1']\"")
|
||||
# cmdline("gsettings set org.gnome.desktop.wm.keybindings panel-run-dialog \"['<Primary><Shift>Space','<Primary>Space']\"")
|
||||
@@ -163,12 +164,14 @@ def setShortcuts():
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-left ['']")
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-right ['']")
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings minimize \"['<Super>h','<Alt>F9']\"")
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings panel-main-menu \"['<Primary><Shift>Space','<Primary>Space']\"")
|
||||
cmdline("gsettings reset org.gnome.desktop.wm.keybindings panel-main-menu")
|
||||
# cmdline("gsettings set org.gnome.desktop.wm.keybindings panel-main-menu \"['<Primary><Shift>Space','<Primary>Space']\"")
|
||||
elif distro == "pop!_os" and dename == "gnome":
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings close \"['<Alt>F4','<Super>w']\"")
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings toggle-maximized \"['<Alt>F10','<Primary><Super>Up']\"")
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings minimize \"['<Super>h','<Alt>F9']\"")
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings panel-main-menu \"['<Primary><Shift>Space','<Primary>Space']\"")
|
||||
cmdline("gsettings reset org.gnome.desktop.wm.keybindings panel-main-menu")
|
||||
# cmdline("gsettings set org.gnome.desktop.wm.keybindings panel-main-menu \"['<Primary><Shift>Space','<Primary>Space']\"")
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-up \"['<Super>Up','<Super>Left']\"")
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-down \"['<Super>Down','<Super>Right']\"")
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-left ['']")
|
||||
@@ -182,7 +185,8 @@ def setShortcuts():
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-applications-backward \"['<Primary>F14','<Primary><Shift>F14','<Alt><Shift>Tab']\"")
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings show-desktop \"['<Super>d','<Super>Down']\"")
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings toggle-maximized \"['<Alt>F10','<Super>Up']\"")
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings panel-main-menu \"['<Control><Shift>Space','<Super>Space']\"")
|
||||
cmdline("gsettings reset org.gnome.desktop.wm.keybindings panel-main-menu")
|
||||
# cmdline("gsettings set org.gnome.desktop.wm.keybindings panel-main-menu \"['<Control><Shift>Space','<Super>Space']\"")
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings minimize \"['<Super>h','<Alt>F9']\"")
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings panel-main-menu \"['<Super>Space','<Primary>Space']\"")
|
||||
if(kintotype == 2):
|
||||
@@ -205,8 +209,11 @@ def setShortcuts():
|
||||
cmdline('xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Primary><Shift>backslash" --create --type string --set "cycle_reverse_windows_key"')
|
||||
# cmdline('xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Super>h" --create --type string --set "hide_window_key"')
|
||||
# Don't need to undo other maps for menu
|
||||
cmdline('xfconf-query --channel xfce4-keyboard-shortcuts --property "/commands/custom/<Primary>space" --create --type string --set "xfce4-popup-whiskermenu"')
|
||||
cmdline('xfconf-query --channel xfce4-keyboard-shortcuts --property "/commands/custom/<Primary><Shift>space" --create --type string --set "xfce4-popup-whiskermenu"')
|
||||
# cmdline('xfconf-query --channel xfce4-keyboard-shortcuts --property "/commands/custom/<Primary>space" --create --type string --set "xfce4-popup-whiskermenu"')
|
||||
# cmdline('xfconf-query --channel xfce4-keyboard-shortcuts --property "/commands/custom/<Primary><Shift>space" --create --type string --set "xfce4-popup-whiskermenu"')
|
||||
cmdline('xfconf-query --reset --channel xfce4-keyboard-shortcuts --property "/commands/custom/<Primary>space"')
|
||||
cmdline('xfconf-query --reset --channel xfce4-keyboard-shortcuts --property "/commands/custom/<Primary><Shift>space"')
|
||||
cmdline('xfconf-query --channel xfce4-keyboard-shortcuts --property "/commands/default/<Primary>Escape" --create --type string --set "xfce4-popup-whiskermenu"')
|
||||
# Reset move to desktop shortcuts
|
||||
cmdline('xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Primary><Alt>Home" --reset')
|
||||
cmdline('xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Primary><Alt>End" --reset')
|
||||
@@ -229,7 +236,8 @@ def setShortcuts():
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-left ['']")
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-right ['']")
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings minimize \"['<Super>h','<Alt>F9']\"")
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings panel-main-menu \"['<Primary><Shift>Space','<Primary>Space']\"")
|
||||
# cmdline("gsettings set org.gnome.desktop.wm.keybindings panel-main-menu \"['<Primary><Shift>Space','<Primary>Space']\"")
|
||||
cmdline("gsettings reset org.gnome.desktop.wm.keybindings panel-main-menu")
|
||||
cmdline("gsettings set org.gnome.mutter.keybindings toggle-tiled-right \"['<Super><Alt>Right']\"")
|
||||
cmdline("gsettings set org.gnome.mutter.keybindings toggle-tiled-left \"['<Super><Alt>Left']\"")
|
||||
# org.gnome.mutter.keybindings toggle-tiled-right ['<Super>Right']
|
||||
|
@@ -111,6 +111,9 @@ GroupAdd, ConEmu, ahk_exe ConEmu.exe
|
||||
GroupAdd, ConEmu, ahk_exe ConEmu64.exe
|
||||
GroupAdd, ConEmu, ahk_exe WindowsTerminal.exe
|
||||
|
||||
GroupAdd, ExcPaste, ahk_exe Cmd.exe
|
||||
GroupAdd, ExcPaste, ahk_exe mintty.exe
|
||||
|
||||
GroupAdd, editors, ahk_exe sublime_text.exe
|
||||
GroupAdd, editors, ahk_exe VSCodium.exe
|
||||
GroupAdd, editors, ahk_exe Code.exe
|
||||
@@ -447,31 +450,45 @@ GroupAdd, intellij, ahk_exe idea64.exe
|
||||
#IfWinActive ahk_group terminals
|
||||
|
||||
; End of Line
|
||||
#e::
|
||||
#e:: ; Default
|
||||
; !e:: ; CB/IBM
|
||||
Send {End}
|
||||
return
|
||||
|
||||
; Beginning of Line
|
||||
#a::
|
||||
#a:: ; Default
|
||||
; !a:: ; CB/IBM
|
||||
Send {Home}
|
||||
return
|
||||
|
||||
; Copy
|
||||
^c::
|
||||
SetKeyDelay -1
|
||||
Send {Blind}{LShift down}{c DownTemp}
|
||||
If WinActive("ahk_exe cmd.exe"){
|
||||
Send {Enter}
|
||||
}
|
||||
else if WinActive("ahk_exe mintty.exe"){
|
||||
SetKeyDelay -1
|
||||
Send {Blind}{Insert}
|
||||
}
|
||||
else{
|
||||
SetKeyDelay -1
|
||||
Send {Blind}{LShift down}{c DownTemp}
|
||||
}
|
||||
return
|
||||
|
||||
^c up::
|
||||
SetKeyDelay -1
|
||||
Send {Blind}{c Up}{LShift Up}
|
||||
If not WinActive("ahk_group cmd.exe"){
|
||||
SetKeyDelay -1
|
||||
Send {Blind}{c Up}{LShift Up}
|
||||
}
|
||||
return
|
||||
|
||||
; Sigints - interrupt
|
||||
$#c::Send {Ctrl down}c{Ctrl up}
|
||||
$#c::Send {Ctrl down}c{Ctrl up} ; Default
|
||||
; $!c::Send {Ctrl down}c{Ctrl up} ; CB/IBM
|
||||
|
||||
; Paste
|
||||
^v::
|
||||
$^v::
|
||||
If WinActive("ahk_exe mintty.exe"){
|
||||
Send {Shift down}{Insert}{Shift up}
|
||||
}
|
||||
|
@@ -92,8 +92,8 @@ define_keymap(re.compile("jetbrains-idea", re.IGNORECASE),{
|
||||
K("C-Super-g"): K("C-M-Shift-j"), # Select all occurrences
|
||||
K("Super-Shift-g"): K("M-Shift-j"), # Unselect occurrence
|
||||
# Editing
|
||||
K("Super-Space"): K("C-Space"), # Basic code completion
|
||||
K("Super-Shift-Space"): K("C-Shift-Space"), # Smart code completion
|
||||
K("Super-Space"): K("LC-Space"), # Basic code completion
|
||||
K("Super-Shift-Space"): K("LC-Shift-Space"),# Smart code completion
|
||||
K("Super-j"): K("C-q"), # Quick documentation lookup
|
||||
K("C-n"): K("M-Insert"), # Generate code...
|
||||
K("Super-o"): K("C-o"), # Override methods
|
||||
@@ -171,6 +171,9 @@ define_keymap(re.compile(browserStr, re.IGNORECASE),{
|
||||
})
|
||||
|
||||
define_keymap(None,{
|
||||
# Launch Application Menu
|
||||
# K("RC-Space"): K("Alt-F1"), # gnome/kde
|
||||
# K("RC-Space"): K("LC-Esc"), # xfce4
|
||||
# Basic App hotkey functions
|
||||
K("RC-Q"): K("Alt-F4"),
|
||||
K("RC-H"): K("Alt-F9"),
|
||||
@@ -214,7 +217,6 @@ define_keymap(None,{
|
||||
})
|
||||
|
||||
define_keymap(lambda wm_class: wm_class.casefold() not in mscodes,{
|
||||
K("Super-Space"): K("C-Space"), # Basic code completion
|
||||
# Wordwise remaining - for Everything but VS Code
|
||||
K("M-Left"): K("C-Left"), # Left of Word
|
||||
K("M-Shift-Left"): K("C-Shift-Left"), # Select Left of Word
|
||||
@@ -239,6 +241,7 @@ define_keymap(lambda wm_class: wm_class.casefold() not in mscodes,{
|
||||
|
||||
# Keybindings for VS Code
|
||||
define_keymap(re.compile(codeStr, re.IGNORECASE),{
|
||||
K("Super-Space"): K("LC-Space"), # Basic code completion
|
||||
# Wordwise remaining - for VS Code
|
||||
# Alt-F19 hack fixes Alt menu activation
|
||||
K("M-Left"): [K("M-F19"),K("C-Left")], # Left of Word
|
||||
|
@@ -60,13 +60,13 @@ function uninstall {
|
||||
fi
|
||||
elif [ "$dename" == "kde" ]; then
|
||||
echo "Restoring DE hotkeys..."
|
||||
kwinkeys = $(ls | grep -m1 "kwinrc")
|
||||
kdekeys = $(ls | grep -m1 "kglobalshortcutsrc")
|
||||
kwinkeys=$(ls | grep -m1 "kwinrc")
|
||||
kdekeys=$(ls | grep -m1 "kglobalshortcutsrc")
|
||||
cp ./"$kdekeys" ~/.config/kglobalshortcutsrc
|
||||
cp ./"$kwinkeys" ~/.config/kwinrc
|
||||
elif [ "$dename" == "xfce" ]; then
|
||||
echo "Restoring DE hotkeys..."
|
||||
xfcekeys = $(ls | grep -m1 "xfce4-keyboard")
|
||||
xfcekeys=$(ls | grep -m1 "xfce4-keyboard")
|
||||
cp ./"$xfcekeys" ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml
|
||||
fi
|
||||
fi
|
||||
@@ -337,6 +337,14 @@ if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "winmac" || $1 == "mac" || $1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $dename == "gnome" || dename == "budgie" ]]; then
|
||||
perl -pi -e "s/(# )(.*)(# gnome)/\$2\$3/g" ./xkeysnail-config/kinto.py.new >/dev/null 2>&1
|
||||
fi
|
||||
if [[ $dename == "kde" ]]; then
|
||||
echo "Applying Cmd-Space to open App Launcher for KDE..."
|
||||
perl -pi -e "s/(# )(.*)(#.*kde)/\$2\$3/g" ./xkeysnail-config/kinto.py.new >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
if [[ $1 == "1" || $1 == "winmac" ]]; 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
|
||||
@@ -364,6 +372,11 @@ elif [[ $1 == "3" || $1 == "chromebook" ]]; then
|
||||
perl -pi -e "s/(# )(.*)(# xfce4)/\$2\$3/g" ./xkeysnail-config/kinto.py.new
|
||||
perl -pi -e "s/(\w.*)(# Default)/# \$1\$2/g" ./xkeysnail-config/kinto.py.new
|
||||
fi
|
||||
if [[ $dename == "xfce" ]] && ls /etc/apt/sources.list.d/enso* 1> /dev/null 2>&1; then
|
||||
echo "enso OS detected, applying Cmd-Space for Launchy..."
|
||||
perl -pi -e "s/(K\(\"RC-Space)(.*)(# )(xfce4)/\$3\$1\$2\$3\$4/g" ./xkeysnail-config/kinto.py.new >/dev/null 2>&1
|
||||
xfconf-query --channel xfce4-keyboard-shortcuts --property "/commands/custom/<Primary>space" --create --type string --set "launchy"
|
||||
fi
|
||||
|
||||
if $rightalt ; then
|
||||
perl -pi -e "s/(\w.*)(Multi-language)/# \$1\$2/g" ./xkeysnail-config/kinto.py.new >/dev/null 2>&1
|
||||
|
Reference in New Issue
Block a user