From 5b2a2c88c251cdde668b711aba04382dd9440669 Mon Sep 17 00:00:00 2001 From: RedBearAK <64876997+RedBearAK@users.noreply.github.com> Date: Sat, 11 Dec 2021 02:17:36 -0900 Subject: [PATCH 1/2] Remap keys for Ulauncher Ulauncher displays shortcuts on each line of results to activate that line with a keyboard shortcut. This could mean launching an application, opening a file, or navigating through a directory hierarchy with a file/directory extension. All shortcuts are based on the Alt key, with numbers 1-9 and then letters if there are enough search results being displayed. Kinto remaps the Alt key to be Ctrl, so this just remaps Ctrl+[number] and Ctrl+[letter] back to Alt+[number] and Alt+[letter] when WM_CLASS is "ulauncher", to allow the user to continue using the physical Alt key shortcuts to activate Ulauncher search results. On a 1080p display, using a file/directory search extension in Ulauncher, I have seen search results with shortcuts from "Alt+1" to at least "Alt+g" being displayed. With this remapping everything seems to work fine for me. I don't know if a high resolution monitor will display all the way up to "Alt+z" but I went ahead and included the whole alphabet just to be sure. --- linux/kinto.py | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/linux/kinto.py b/linux/kinto.py index 4c1d086..7e95b24 100755 --- a/linux/kinto.py +++ b/linux/kinto.py @@ -447,6 +447,44 @@ define_keymap(re.compile(chromeStr, re.IGNORECASE),{ }, "Browsers") # Opera C-F12 +define_keymap(re.compile("ulauncher", re.IGNORECASE),{ + K("RC-Key_1"): K("M-Key_1"), # Remap Ctrl+[1-9] and Ctrl+[a-z] to Alt+[1-9] and Alt+[a-z] + K("RC-Key_2"): K("M-Key_2"), + K("RC-Key_3"): K("M-Key_3"), + K("RC-Key_4"): K("M-Key_4"), + K("RC-Key_5"): K("M-Key_5"), + K("RC-Key_6"): K("M-Key_6"), + K("RC-Key_7"): K("M-Key_7"), + K("RC-Key_8"): K("M-Key_8"), + K("RC-Key_9"): K("M-Key_9"), + K("RC-a"): K("M-a"), + K("RC-b"): K("M-b"), + K("RC-c"): K("M-c"), + K("RC-d"): K("M-d"), + K("RC-e"): K("M-e"), + K("RC-f"): K("M-f"), + K("RC-g"): K("M-g"), + K("RC-h"): K("M-h"), + K("RC-i"): K("M-i"), + K("RC-j"): K("M-j"), + K("RC-k"): K("M-k"), + K("RC-l"): K("M-l"), + K("RC-m"): K("M-m"), + K("RC-n"): K("M-n"), + K("RC-o"): K("M-o"), + K("RC-p"): K("M-p"), + K("RC-q"): K("M-q"), + K("RC-r"): K("M-r"), + K("RC-s"): K("M-s"), + K("RC-t"): K("M-t"), + K("RC-u"): K("M-u"), + K("RC-v"): K("M-v"), + K("RC-w"): K("M-w"), + K("RC-x"): K("M-x"), + K("RC-y"): K("M-y"), + K("RC-z"): K("M-z"), +}, "Ulauncher") + # Note: terminals extends to remotes as well define_keymap(lambda wm_class: wm_class.casefold() not in terminals,{ K("RC-Dot"): K("Esc"), # Mimic macOS Cmd+dot = Escape key (not in terminals) From f7ff8d1728ae4be1a9ee2ea34fa21f762b41b11f Mon Sep 17 00:00:00 2001 From: RedBearAK <64876997+RedBearAK@users.noreply.github.com> Date: Sat, 11 Dec 2021 02:26:50 -0900 Subject: [PATCH 2/2] Comment out Ctrl+Q shortcut --- linux/kinto.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/kinto.py b/linux/kinto.py index 7e95b24..23441b0 100755 --- a/linux/kinto.py +++ b/linux/kinto.py @@ -473,7 +473,7 @@ define_keymap(re.compile("ulauncher", re.IGNORECASE),{ K("RC-n"): K("M-n"), K("RC-o"): K("M-o"), K("RC-p"): K("M-p"), - K("RC-q"): K("M-q"), + # K("RC-q"): K("M-q"), K("RC-r"): K("M-r"), K("RC-s"): K("M-s"), K("RC-t"): K("M-t"),