- Adding in cmd-space hotfixes

This commit is contained in:
Ben Reaves
2020-10-11 20:15:13 -05:00
4 changed files with 51 additions and 23 deletions

View File

@@ -1,6 +1,6 @@
# Kinto # Kinto.sh
![kinto-color-132](https://user-images.githubusercontent.com/10969616/84361571-7d5bd780-ab91-11ea-81bc-4d3a2ca51c4e.png) ![kinto-color-132](https://user-images.githubusercontent.com/10969616/94909977-9d2d4900-0469-11eb-8710-986289fe7240.gif)
[![GitHub release](https://img.shields.io/github/release/rbreaves/kinto.svg)](https://github.com/rbreaves/kinto/releases/latest) [![GitHub release](https://img.shields.io/github/release/rbreaves/kinto.svg)](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%">| |<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 ## Table of Contents
[What does this do exactly?](#What-does-this-do-exactly) [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| |**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? ## 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. 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. 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 Status
``` ```
systemctl --user status keyswap
sudo systemctl status xkeysnail sudo systemctl status xkeysnail
systemctl --user status keyswap # older - you probably should not run this one
``` ```
Stop (your keymap will return to normal) Stop (your keymap will return to normal)
``` ```
systemctl --user stop keyswap
sudo systemctl stop xkeysnail sudo systemctl stop xkeysnail
systemctl --user stop keyswap # older - you probably should not run this one
``` ```
Start Start
``` ```
systemctl --user start keyswap
sudo systemctl start xkeysnail sudo systemctl start xkeysnail
systemctl --user start keyswap # older - you probably should not run this one
``` ```
Restart Restart
``` ```
systemctl --user restart keyswap
sudo systemctl restart xkeysnail sudo systemctl restart xkeysnail
systemctl --user restart keyswap # older - you probably should not run this one
``` ```
Enable Enable
``` ```
systemctl --user enable keyswap
sudo systemctl enable xkeysnail sudo systemctl enable xkeysnail
systemctl --user enable keyswap # older - you probably should not run this one
``` ```
Disable Disable
``` ```
systemctl --user disable keyswap
sudo systemctl disable xkeysnail sudo systemctl disable xkeysnail
systemctl --user disable keyswap # older - you probably should not run this one
``` ```
## Learning macOS style hotkeys on Linux ## Learning macOS style hotkeys on Linux

View File

@@ -167,7 +167,8 @@ def setShortcuts():
# Too slow on appearing, compared to the app menu # Too slow on appearing, compared to the app menu
# #
# if dename != "budgie": # 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: # else:
# cmdline("gsettings set org.gnome.desktop.wm.keybindings panel-main-menu \"['<Alt>F1']\"") # 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']\"") # cmdline("gsettings set org.gnome.desktop.wm.keybindings panel-run-dialog \"['<Primary><Shift>Space','<Primary>Space']\"")
@@ -180,12 +181,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-left ['']")
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-right ['']") 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 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": 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 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 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 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-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-down \"['<Super>Down','<Super>Right']\"")
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-left ['']") cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-left ['']")
@@ -199,7 +202,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 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 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 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 minimize \"['<Super>h','<Alt>F9']\"")
cmdline("gsettings set org.gnome.desktop.wm.keybindings panel-main-menu \"['<Super>Space','<Primary>Space']\"") cmdline("gsettings set org.gnome.desktop.wm.keybindings panel-main-menu \"['<Super>Space','<Primary>Space']\"")
if(kintotype == 2): if(kintotype == 2):
@@ -222,8 +226,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/<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"') # 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 # 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>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><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 # 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>Home" --reset')
cmdline('xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Primary><Alt>End" --reset') cmdline('xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Primary><Alt>End" --reset')
@@ -246,7 +253,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-left ['']")
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-right ['']") 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 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-right \"['<Super><Alt>Right']\"")
cmdline("gsettings set org.gnome.mutter.keybindings toggle-tiled-left \"['<Super><Alt>Left']\"") cmdline("gsettings set org.gnome.mutter.keybindings toggle-tiled-left \"['<Super><Alt>Left']\"")
# org.gnome.mutter.keybindings toggle-tiled-right ['<Super>Right'] # org.gnome.mutter.keybindings toggle-tiled-right ['<Super>Right']

View File

@@ -121,8 +121,8 @@ define_keymap(re.compile("jetbrains-idea", re.IGNORECASE),{
K("C-Super-g"): K("C-M-Shift-j"), # Select all occurrences K("C-Super-g"): K("C-M-Shift-j"), # Select all occurrences
K("Super-Shift-g"): K("M-Shift-j"), # Unselect occurrence K("Super-Shift-g"): K("M-Shift-j"), # Unselect occurrence
# Editing # Editing
K("Super-Space"): K("C-Space"), # Basic code completion K("Super-Space"): K("LC-Space"), # Basic code completion
K("Super-Shift-Space"): K("C-Shift-Space"), # Smart code completion K("Super-Shift-Space"): K("LC-Shift-Space"),# Smart code completion
K("Super-j"): K("C-q"), # Quick documentation lookup K("Super-j"): K("C-q"), # Quick documentation lookup
K("C-n"): K("M-Insert"), # Generate code... K("C-n"): K("M-Insert"), # Generate code...
K("Super-o"): K("C-o"), # Override methods K("Super-o"): K("C-o"), # Override methods
@@ -200,6 +200,9 @@ define_keymap(re.compile(browserStr, re.IGNORECASE),{
}) })
define_keymap(None,{ 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 # Basic App hotkey functions
K("RC-Q"): K("Alt-F4"), K("RC-Q"): K("Alt-F4"),
K("RC-H"): K("Alt-F9"), K("RC-H"): K("Alt-F9"),
@@ -243,7 +246,6 @@ define_keymap(None,{
}) })
define_keymap(lambda wm_class: wm_class.casefold() not in mscodes,{ 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 # Wordwise remaining - for Everything but VS Code
K("M-Left"): K("C-Left"), # Left of Word K("M-Left"): K("C-Left"), # Left of Word
K("M-Shift-Left"): K("C-Shift-Left"), # Select Left of Word K("M-Shift-Left"): K("C-Shift-Left"), # Select Left of Word
@@ -268,6 +270,7 @@ define_keymap(lambda wm_class: wm_class.casefold() not in mscodes,{
# Keybindings for VS Code # Keybindings for VS Code
define_keymap(re.compile(codeStr, re.IGNORECASE),{ define_keymap(re.compile(codeStr, re.IGNORECASE),{
K("Super-Space"): K("LC-Space"), # Basic code completion
# Wordwise remaining - for VS Code # Wordwise remaining - for VS Code
# Alt-F19 hack fixes Alt menu activation # Alt-F19 hack fixes Alt menu activation
K("M-Left"): [K("M-F19"),K("C-Left")], # Left of Word K("M-Left"): [K("M-F19"),K("C-Left")], # Left of Word

View File

@@ -60,13 +60,13 @@ function uninstall {
fi fi
elif [ "$dename" == "kde" ]; then elif [ "$dename" == "kde" ]; then
echo "Restoring DE hotkeys..." echo "Restoring DE hotkeys..."
kwinkeys = $(ls | grep -m1 "kwinrc") kwinkeys=$(ls | grep -m1 "kwinrc")
kdekeys = $(ls | grep -m1 "kglobalshortcutsrc") kdekeys=$(ls | grep -m1 "kglobalshortcutsrc")
cp ./"$kdekeys" ~/.config/kglobalshortcutsrc cp ./"$kdekeys" ~/.config/kglobalshortcutsrc
cp ./"$kwinkeys" ~/.config/kwinrc cp ./"$kwinkeys" ~/.config/kwinrc
elif [ "$dename" == "xfce" ]; then elif [ "$dename" == "xfce" ]; then
echo "Restoring DE hotkeys..." 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 cp ./"$xfcekeys" ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml
fi fi
fi fi
@@ -339,6 +339,14 @@ if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "4" || $1 == "winmac" || $1 =
fi fi
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 [[ $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 /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
@@ -371,6 +379,11 @@ elif [[ $1 == "4" || $1 == "ibm" ]]; then
# perl -pi -e "s/(# )(.*)(# xfce4)/\$2\$3/g" ./xkeysnail-config/kinto.py.new # 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 perl -pi -e "s/(\w.*)(# Default)/# \$1\$2/g" ./xkeysnail-config/kinto.py.new
fi 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 if $rightalt ; then
perl -pi -e "s/(\w.*)(Multi-language)/# \$1\$2/g" ./xkeysnail-config/kinto.py.new >/dev/null 2>&1 perl -pi -e "s/(\w.*)(Multi-language)/# \$1\$2/g" ./xkeysnail-config/kinto.py.new >/dev/null 2>&1