From acd0b8031e25c2da4a29cc4b99d424af7e3e6dd6 Mon Sep 17 00:00:00 2001 From: Ben Reaves Date: Mon, 6 Jul 2020 20:20:16 -0500 Subject: [PATCH 1/4] - Added proper quit hotkey for browsers (linux) --- xkeysnail-config/kinto.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/xkeysnail-config/kinto.py b/xkeysnail-config/kinto.py index ea15741..2ad8d1b 100644 --- a/xkeysnail-config/kinto.py +++ b/xkeysnail-config/kinto.py @@ -10,6 +10,11 @@ terminals = ["gnome-terminal","konsole","io.elementary.terminal","terminator","s terminals = [term.casefold() for term in terminals] termStr = "|".join(str(x) for x in terminals) +# Use for browser specific hotkeys +browsers = ["Chromium","Chromium-browser","Google-chrome","Epiphany","Firefox"] +browsers = [browser.casefold() for browser in browsers] +browserStr = "|".join(str(x) for x in browsers) + mscodes = ["code","vscodium"] codeStr = "|".join(str(x) for x in mscodes) @@ -69,6 +74,11 @@ define_keymap(re.compile("org.gnome.nautilus", re.IGNORECASE),{ 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,{ # Basic App hotkey functions K("RC-Q"): K("Alt-F4"), From a3d8ac782a9d3f9f6fe248e01deb19ea6f97ef1a Mon Sep 17 00:00:00 2001 From: TheBitStick Date: Mon, 6 Jul 2020 23:23:30 -0500 Subject: [PATCH 2/4] Electron Apps have their own names unfortunately #232 --- xkeysnail-config/kinto.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xkeysnail-config/kinto.py b/xkeysnail-config/kinto.py index 2ad8d1b..9181c09 100644 --- a/xkeysnail-config/kinto.py +++ b/xkeysnail-config/kinto.py @@ -11,7 +11,7 @@ terminals = [term.casefold() for term in terminals] termStr = "|".join(str(x) for x in terminals) # Use for browser specific hotkeys -browsers = ["Chromium","Chromium-browser","Google-chrome","Epiphany","Firefox"] +browsers = ["Chromium","Chromium-browser","Google-chrome","Epiphany","Firefox","Discord"] browsers = [browser.casefold() for browser in browsers] browserStr = "|".join(str(x) for x in browsers) From e477848b591ca710dc1286b846a760f6c10c6690 Mon Sep 17 00:00:00 2001 From: Ben Reaves Date: Tue, 7 Jul 2020 16:15:32 -0500 Subject: [PATCH 3/4] - Removes appending argument from alt/cmd swap on official apple keyboards. Closes #233 --- xkeysnail_service.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/xkeysnail_service.sh b/xkeysnail_service.sh index 8920550..8211037 100755 --- a/xkeysnail_service.sh +++ b/xkeysnail_service.sh @@ -75,13 +75,13 @@ function uninstall { function removeAppleKB { # 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 - echo '0' | sudo tee -a /sys/module/hid_apple/parameters/swap_opt_cmd - echo 'options hid_apple swap_opt_cmd=0' | sudo tee -a /etc/modprobe.d/hid_apple.conf + echo '0' | sudo tee /sys/module/hid_apple/parameters/swap_opt_cmd + echo 'options hid_apple swap_opt_cmd=0' | sudo tee /etc/modprobe.d/hid_apple.conf sudo update-initramfs -u -k all fi if test -f "/sys/module/applespi/parameters/swap_opt_cmd" && [ `cat /sys/module/applespi/parameters/swap_opt_cmd` == "1" ]; then - echo '0' | sudo tee -a /sys/module/applespi/parameters/swap_opt_cmd - echo 'options applespi swap_opt_cmd=0' | sudo tee -a /etc/modprobe.d/applespi.conf + echo '0' | sudo tee /sys/module/applespi/parameters/swap_opt_cmd + echo 'options applespi swap_opt_cmd=0' | sudo tee /etc/modprobe.d/applespi.conf sudo update-initramfs -u -k all fi } @@ -270,10 +270,10 @@ fi if [[ $1 == "1" || $1 == "winmac" ]]; then if ls /sys/module | grep hid_apple >/dev/null 2>&1 ; then - 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 + 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 fi if ls /sys/module | grep applespi >/dev/null 2>&1 ; then - 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 + 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 fi if ! ls /sys/module | grep apple ; then removeAppleKB From 2864ae409a0d150769c0d21e59a5f2d47fa98a43 Mon Sep 17 00:00:00 2001 From: Ben Reaves Date: Tue, 7 Jul 2020 16:54:33 -0500 Subject: [PATCH 4/4] - Added proper quit hotkey for browsers, except edge (windows). Closes #232 --- windows/kinto.ahk | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/windows/kinto.ahk b/windows/kinto.ahk index dbe80b4..cda1156 100644 --- a/windows/kinto.ahk +++ b/windows/kinto.ahk @@ -96,6 +96,12 @@ GroupAdd, editors, ahk_exe sublime_text.exe GroupAdd, editors, ahk_exe VSCodium.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 Code.exe @@ -202,6 +208,11 @@ $^+Right::Send +{End} ; Cmd+Space Alternative ^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 #IfWinActive ahk_group vscode ; Remap Ctrl+Shift to behave like macOS Sublimetext