From 3ad2a7f518d23129644cb2c44c4bddbc53d80a51 Mon Sep 17 00:00:00 2001 From: Ben Reaves Date: Fri, 28 Aug 2020 01:12:23 -0500 Subject: [PATCH] - Prepping Kinto for Caps2Esc/Cmd, and Tweaks options --- xkeysnail-config/kinto.py | 8 +++ .../trayapps/appindicator/kintotray.py | 52 +++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/xkeysnail-config/kinto.py b/xkeysnail-config/kinto.py index 31e1286..d4d11f6 100644 --- a/xkeysnail-config/kinto.py +++ b/xkeysnail-config/kinto.py @@ -19,8 +19,16 @@ browserStr = "|".join(str(x) for x in browsers) mscodes = ["code","vscodium"] codeStr = "|".join(str(x) for x in mscodes) +define_multipurpose_modmap( + # {Key.ENTER: [Key.ENTER, Key.RIGHT_CTRL]} # Enter2Cmd + # {Key.CAPSLOCK: [Key.ESC, Key.RIGHT_CTRL] # Caps2Esc +) + # [Global modemap] Change modifier keys as in xmodmap define_conditional_modmap(lambda wm_class: wm_class.casefold() not in terminals,{ + + # Key.CAPSLOCK: Key.RIGHT_CTRL, # Caps2Cmd + # # IBM # Key.LEFT_ALT: Key.RIGHT_CTRL, # IBM # Key.LEFT_CTRL: Key.LEFT_ALT, # IBM diff --git a/xkeysnail-config/trayapps/appindicator/kintotray.py b/xkeysnail-config/trayapps/appindicator/kintotray.py index dc7abd0..2e4ab7f 100755 --- a/xkeysnail-config/trayapps/appindicator/kintotray.py +++ b/xkeysnail-config/trayapps/appindicator/kintotray.py @@ -179,6 +179,23 @@ class Indicator(): win.set_default_size(350, 200) win.set_position(Gtk.WindowPosition.CENTER) + # Check options + + # Check AltGr - commented out is enabled + # (\s{5})(#.*)(Multi-language) + + # Sublime enabled for vscode + # (\s{4}\w.*)(- Sublime) + + # Caps2Esc enabled + # (\s{4}{\w.*)(# Caps2Esc) + + # Caps2Cmd enabled + # (\s{4}\w.*)(# Caps2Cmd) + + # Enter2Cmd enabled + # (\s{4}{\w.*)(# Enter2Cmd) + vbox = Gtk.VBox() self.lbl = Gtk.Label() @@ -201,15 +218,50 @@ class Indicator(): return def setRightMod(self,button): + # Check keyboard type that is set + + # Apply toggle for the multi-language of type set + # (\s{5})(# )(.*)(# Mac)( - Multi-language.*)|(\s{5})(K)(.*)(# )(Mac)( - Multi-language.*) + # $1$3$4$5$6$9$7$8$9$10$11 + + # Restart service if Kinto is enabled return def setVSC2ST3(self,button): + + # Apply toggle + # ^(\s{4})(\w.*)(# )(.*- Sublime)|^(\s{4})(# )(\w.*)(# .*- Sublime) + # $5$7$8$1$3$2$3$4 + + # Restart service if Kinto is enabled return def setCaps2Esc(self,button): return def setCaps2Cmd(self,button): + + # If IBM and enabling + # Turn on Caps2Cmd, turn off IBM caps remap + # (\s{4})(# )(\w.*)(# Caps2Cmd)|(\s{4})(\w.*)(# )(Caps2Cmd)|(\s{5})(.*)(# )(IBM - Caps2.*) + # $1$3$4$5$7$6$7$8$9$11$10$11$12 + + # If IBM and disabling + # Turn off Caps2Cmd and turn on IBM caps remap + # (\s{4})(# )(\w.*)(# Caps2Cmd)|(\s{4})(\w.*)(# )(Caps2Cmd)|(\s{5})(# )(.*)(# )(IBM - Caps2.*) + # $1$3$4$5$7$6$7$8$9$11$12$13 + + # If Chromebook and enabling + # Turn on Caps2Cmd, turn off Chromebook caps remap + + # If Chromebook and disabling + # Turn off Caps2Cmd and turn on Chromebook caps remap + + # else + # Apply toggle - Generic toggle + # (\s{4})(# )(\w.*)(# Caps2Cmd)|(\s{4})(\w.*)(# )(Caps2Cmd) + # $1$3$4$5$7$6$7$8 + return def queryConfig(self,query):