diff --git a/xkeysnail-config/kinto.py b/xkeysnail-config/kinto.py index d4d11f6..1b9c61d 100644 --- a/xkeysnail-config/kinto.py +++ b/xkeysnail-config/kinto.py @@ -22,12 +22,15 @@ 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 + # {Key.LEFT_META: [Key.ESC, Key.RIGHT_CTRL] # Caps2Esc - Chromebook + {} # Placeholder ) # [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 + # Key.LEFT_META: Key.RIGHT_CTRL, # Caps2Cmd - Chromebook # # IBM # Key.LEFT_ALT: Key.RIGHT_CTRL, # IBM diff --git a/xkeysnail-config/trayapps/appindicator/kintotray.py b/xkeysnail-config/trayapps/appindicator/kintotray.py index 2e4ab7f..740eabb 100755 --- a/xkeysnail-config/trayapps/appindicator/kintotray.py +++ b/xkeysnail-config/trayapps/appindicator/kintotray.py @@ -237,31 +237,68 @@ class Indicator(): return def setCaps2Esc(self,button): + + # If IBM and enabling + # Turn on Caps2Esc, turn off IBM caps remap + # (\s{4})(# )({\w.*)(# Caps2Esc\n)|(\s{5})(.*)(# )(IBM - Caps2.*) + # $1$3$4$5$7$6$7$8 + + # If IBM and disabling + # Turn off Caps2Esc and turn on IBM caps remap + # (\s{4})({\w.*)(# )(Caps2Esc\n)|(\s{5})(# )(.*)(# IBM - Caps2.*) + # $1$3$2$3$4$5$7$8 + + # If Chromebook and enabling + # Turn on Caps2Esc, turn off Chromebook caps remap + # (\s{4})(# )({\w.*)(# Caps2Esc - Chromebook)|(\s{5})(Key\.LEFT_META.*)(# )(Chromebook) + # $1$3$4$5$7$6$7$8 + + + # If Chromebook and disabling + # Turn off Caps2Esc and turn on Chromebook caps remap + # (\s{4})({\w.*)(# )(Caps2Esc - Chromebook)|(\s{5})(# )(Key\.LEFT_META.*)(# )(Chromebook) + # $1$3$2$3$4$5$5$7$8$9 + + + # else + # Apply toggle - Generic toggle + # (\s{4})(# )({\w.*)(# )(Caps2Esc\n)|(\s{4})({\w.*)(# )(Caps2Esc\n) + # $1$3$2$3$4$5$6$8$7$8$9 + + # Restart service if Kinto is enabled + + 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.*) + # (\s{4})(# )(\w.*)(# Caps2Cmd\n)|(\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.*) + # (\s{4})(# )(\w.*)(# Caps2Cmd\n)|(\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 + # (\s{4})(# )(\w.*)(# Caps2Cmd - Chromebook)|(\s{5})(Key\.LEFT_META.*)(# )(Chromebook) + # $1$3$4$5$7$6$7$8 # If Chromebook and disabling # Turn off Caps2Cmd and turn on Chromebook caps remap + # (\s{4})(\w.*)(# )(Caps2Cmd - Chromebook)|(\s{5})(# )(Key\.LEFT_META.*)(# )(Chromebook) + # $1$3$2$3$4$5$7$8$9 # else # Apply toggle - Generic toggle - # (\s{4})(# )(\w.*)(# Caps2Cmd)|(\s{4})(\w.*)(# )(Caps2Cmd) + # (\s{4})(# )(\w.*)(# Caps2Cmd\n)|(\s{4})(\w.*)(# )(Caps2Cmd) # $1$3$4$5$7$6$7$8 + # Restart service if Kinto is enabled + return def queryConfig(self,query):