diff --git a/examples/logitech-mx-keys.json b/examples/logitech-mx-keys.json new file mode 100644 index 0000000..a108ae9 --- /dev/null +++ b/examples/logitech-mx-keys.json @@ -0,0 +1,909 @@ +{ + "title": "lushlayers-logitech-mx-keys", + "rules": [ + { + "description": "lushlayers-logitech-mx-keys", + "manipulators": [ + { + "type": "basic", + "conditions": [ + { + "type": "device_if", + "identifiers": [ + { + "vendor_id": 1133, + "product_id": 45915 + } + ] + }, + { + "type": "variable_if", + "name": "layer", + "value": 0 + } + ], + "from": { + "key_code": "non_us_backslash" + }, + "to": [ + { + "key_code": "escape" + } + ] + }, + { + "type": "basic", + "conditions": [ + { + "type": "device_if", + "identifiers": [ + { + "vendor_id": 1133, + "product_id": 45915 + } + ] + }, + { + "type": "variable_if", + "name": "layer", + "value": 0 + } + ], + "from": { + "key_code": "caps_lock" + }, + "to": [ + { + "set_variable": { + "name": "layer", + "value": "navigation" + } + } + ], + "to_after_key_up": [ + { + "set_variable": { + "name": "layer", + "value": 0 + } + } + ], + "to_if_alone": [ + { + "key_code": "delete_or_backspace" + } + ] + }, + { + "type": "basic", + "conditions": [ + { + "type": "device_if", + "identifiers": [ + { + "vendor_id": 1133, + "product_id": 45915 + } + ] + }, + { + "type": "variable_if", + "name": "layer", + "value": 0 + } + ], + "from": { + "key_code": "right_command" + }, + "to": [ + { + "set_variable": { + "name": "layer", + "value": "symbols" + } + } + ], + "to_after_key_up": [ + { + "set_variable": { + "name": "layer", + "value": 0 + } + } + ], + "to_if_alone": [ + { + "key_code": "right_command" + } + ] + }, + { + "type": "basic", + "conditions": [ + { + "type": "device_if", + "identifiers": [ + { + "vendor_id": 1133, + "product_id": 45915 + } + ] + }, + { + "type": "variable_if", + "name": "layer", + "value": "navigation" + } + ], + "from": { + "key_code": "delete_or_backspace" + }, + "to": [ + { + "key_code": "delete_forward" + } + ] + }, + { + "type": "basic", + "conditions": [ + { + "type": "device_if", + "identifiers": [ + { + "vendor_id": 1133, + "product_id": 45915 + } + ] + }, + { + "type": "variable_if", + "name": "layer", + "value": "navigation" + } + ], + "from": { + "key_code": "w" + }, + "to": [ + { + "shell_command": "open -a Slack" + } + ] + }, + { + "type": "basic", + "conditions": [ + { + "type": "device_if", + "identifiers": [ + { + "vendor_id": 1133, + "product_id": 45915 + } + ] + }, + { + "type": "variable_if", + "name": "layer", + "value": "navigation" + } + ], + "from": { + "key_code": "e" + }, + "to": [ + { + "shell_command": "open -a Mail" + } + ] + }, + { + "type": "basic", + "conditions": [ + { + "type": "device_if", + "identifiers": [ + { + "vendor_id": 1133, + "product_id": 45915 + } + ] + }, + { + "type": "variable_if", + "name": "layer", + "value": "navigation" + } + ], + "from": { + "key_code": "y" + }, + "to": [ + { + "key_code": "home" + } + ] + }, + { + "type": "basic", + "conditions": [ + { + "type": "device_if", + "identifiers": [ + { + "vendor_id": 1133, + "product_id": 45915 + } + ] + }, + { + "type": "variable_if", + "name": "layer", + "value": "navigation" + } + ], + "from": { + "key_code": "u" + }, + "to": [ + { + "key_code": "left_arrow", + "modifiers": [ + "left_option" + ] + } + ] + }, + { + "type": "basic", + "conditions": [ + { + "type": "device_if", + "identifiers": [ + { + "vendor_id": 1133, + "product_id": 45915 + } + ] + }, + { + "type": "variable_if", + "name": "layer", + "value": "navigation" + } + ], + "from": { + "key_code": "i" + }, + "to": [ + { + "key_code": "right_arrow", + "modifiers": [ + "left_option" + ] + } + ] + }, + { + "type": "basic", + "conditions": [ + { + "type": "device_if", + "identifiers": [ + { + "vendor_id": 1133, + "product_id": 45915 + } + ] + }, + { + "type": "variable_if", + "name": "layer", + "value": "navigation" + } + ], + "from": { + "key_code": "o" + }, + "to": [ + { + "key_code": "end" + } + ] + }, + { + "type": "basic", + "conditions": [ + { + "type": "device_if", + "identifiers": [ + { + "vendor_id": 1133, + "product_id": 45915 + } + ] + }, + { + "type": "variable_if", + "name": "layer", + "value": "navigation" + } + ], + "from": { + "key_code": "a" + }, + "to": [ + { + "shell_command": "open -a Spotify" + } + ] + }, + { + "type": "basic", + "conditions": [ + { + "type": "device_if", + "identifiers": [ + { + "vendor_id": 1133, + "product_id": 45915 + } + ] + }, + { + "type": "variable_if", + "name": "layer", + "value": "navigation" + } + ], + "from": { + "key_code": "s" + }, + "to": [ + { + "shell_command": "open -a Vivaldi" + } + ] + }, + { + "type": "basic", + "conditions": [ + { + "type": "device_if", + "identifiers": [ + { + "vendor_id": 1133, + "product_id": 45915 + } + ] + }, + { + "type": "variable_if", + "name": "layer", + "value": "navigation" + } + ], + "from": { + "key_code": "d" + }, + "to": [ + { + "shell_command": "open -a Alacritty" + } + ] + }, + { + "type": "basic", + "conditions": [ + { + "type": "device_if", + "identifiers": [ + { + "vendor_id": 1133, + "product_id": 45915 + } + ] + }, + { + "type": "variable_if", + "name": "layer", + "value": "navigation" + } + ], + "from": { + "key_code": "f" + }, + "to": [ + { + "shell_command": "open -a Dash" + } + ] + }, + { + "type": "basic", + "conditions": [ + { + "type": "device_if", + "identifiers": [ + { + "vendor_id": 1133, + "product_id": 45915 + } + ] + }, + { + "type": "variable_if", + "name": "layer", + "value": "navigation" + } + ], + "from": { + "key_code": "h" + }, + "to": [ + { + "key_code": "left_arrow" + } + ] + }, + { + "type": "basic", + "conditions": [ + { + "type": "device_if", + "identifiers": [ + { + "vendor_id": 1133, + "product_id": 45915 + } + ] + }, + { + "type": "variable_if", + "name": "layer", + "value": "navigation" + } + ], + "from": { + "key_code": "j" + }, + "to": [ + { + "key_code": "down_arrow" + } + ] + }, + { + "type": "basic", + "conditions": [ + { + "type": "device_if", + "identifiers": [ + { + "vendor_id": 1133, + "product_id": 45915 + } + ] + }, + { + "type": "variable_if", + "name": "layer", + "value": "navigation" + } + ], + "from": { + "key_code": "k" + }, + "to": [ + { + "key_code": "up_arrow" + } + ] + }, + { + "type": "basic", + "conditions": [ + { + "type": "device_if", + "identifiers": [ + { + "vendor_id": 1133, + "product_id": 45915 + } + ] + }, + { + "type": "variable_if", + "name": "layer", + "value": "navigation" + } + ], + "from": { + "key_code": "l" + }, + "to": [ + { + "key_code": "right_arrow" + } + ] + }, + { + "type": "basic", + "conditions": [ + { + "type": "device_if", + "identifiers": [ + { + "vendor_id": 1133, + "product_id": 45915 + } + ] + }, + { + "type": "variable_if", + "name": "layer", + "value": "navigation" + } + ], + "from": { + "key_code": "x" + }, + "to": [ + { + "shell_command": "open -a zoom.us" + } + ] + }, + { + "type": "basic", + "conditions": [ + { + "type": "device_if", + "identifiers": [ + { + "vendor_id": 1133, + "product_id": 45915 + } + ] + }, + { + "type": "variable_if", + "name": "layer", + "value": "navigation" + } + ], + "from": { + "key_code": "c" + }, + "to": [ + { + "shell_command": "open -a Calendar" + } + ] + }, + { + "type": "basic", + "conditions": [ + { + "type": "device_if", + "identifiers": [ + { + "vendor_id": 1133, + "product_id": 45915 + } + ] + }, + { + "type": "variable_if", + "name": "layer", + "value": "symbols" + } + ], + "from": { + "key_code": "t" + }, + "to": [ + { + "key_code": "grave_accent_and_tilde", + "modifiers": [ + "left_shift" + ] + } + ] + }, + { + "type": "basic", + "conditions": [ + { + "type": "device_if", + "identifiers": [ + { + "vendor_id": 1133, + "product_id": 45915 + } + ] + }, + { + "type": "variable_if", + "name": "layer", + "value": "symbols" + } + ], + "from": { + "key_code": "a" + }, + "to": [ + { + "key_code": "comma", + "modifiers": [ + "left_shift" + ] + } + ] + }, + { + "type": "basic", + "conditions": [ + { + "type": "device_if", + "identifiers": [ + { + "vendor_id": 1133, + "product_id": 45915 + } + ] + }, + { + "type": "variable_if", + "name": "layer", + "value": "symbols" + } + ], + "from": { + "key_code": "s" + }, + "to": [ + { + "key_code": "open_bracket", + "modifiers": [ + "left_shift" + ] + } + ] + }, + { + "type": "basic", + "conditions": [ + { + "type": "device_if", + "identifiers": [ + { + "vendor_id": 1133, + "product_id": 45915 + } + ] + }, + { + "type": "variable_if", + "name": "layer", + "value": "symbols" + } + ], + "from": { + "key_code": "d" + }, + "to": [ + { + "key_code": "open_bracket" + } + ] + }, + { + "type": "basic", + "conditions": [ + { + "type": "device_if", + "identifiers": [ + { + "vendor_id": 1133, + "product_id": 45915 + } + ] + }, + { + "type": "variable_if", + "name": "layer", + "value": "symbols" + } + ], + "from": { + "key_code": "f" + }, + "to": [ + { + "key_code": "9", + "modifiers": [ + "left_shift" + ] + } + ] + }, + { + "type": "basic", + "conditions": [ + { + "type": "device_if", + "identifiers": [ + { + "vendor_id": 1133, + "product_id": 45915 + } + ] + }, + { + "type": "variable_if", + "name": "layer", + "value": "symbols" + } + ], + "from": { + "key_code": "g" + }, + "to": [ + { + "key_code": "grave_accent_and_tilde" + } + ] + }, + { + "type": "basic", + "conditions": [ + { + "type": "device_if", + "identifiers": [ + { + "vendor_id": 1133, + "product_id": 45915 + } + ] + }, + { + "type": "variable_if", + "name": "layer", + "value": "symbols" + } + ], + "from": { + "key_code": "h" + }, + "to": [ + { + "key_code": "quote", + "modifiers": [ + "left_shift" + ] + } + ] + }, + { + "type": "basic", + "conditions": [ + { + "type": "device_if", + "identifiers": [ + { + "vendor_id": 1133, + "product_id": 45915 + } + ] + }, + { + "type": "variable_if", + "name": "layer", + "value": "symbols" + } + ], + "from": { + "key_code": "j" + }, + "to": [ + { + "key_code": "0", + "modifiers": [ + "left_shift" + ] + } + ] + }, + { + "type": "basic", + "conditions": [ + { + "type": "device_if", + "identifiers": [ + { + "vendor_id": 1133, + "product_id": 45915 + } + ] + }, + { + "type": "variable_if", + "name": "layer", + "value": "symbols" + } + ], + "from": { + "key_code": "k" + }, + "to": [ + { + "key_code": "close_bracket" + } + ] + }, + { + "type": "basic", + "conditions": [ + { + "type": "device_if", + "identifiers": [ + { + "vendor_id": 1133, + "product_id": 45915 + } + ] + }, + { + "type": "variable_if", + "name": "layer", + "value": "symbols" + } + ], + "from": { + "key_code": "l" + }, + "to": [ + { + "key_code": "close_bracket", + "modifiers": [ + "left_shift" + ] + } + ] + }, + { + "type": "basic", + "conditions": [ + { + "type": "device_if", + "identifiers": [ + { + "vendor_id": 1133, + "product_id": 45915 + } + ] + }, + { + "type": "variable_if", + "name": "layer", + "value": "symbols" + } + ], + "from": { + "key_code": "semicolon" + }, + "to": [ + { + "key_code": "period", + "modifiers": [ + "left_shift" + ] + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/examples/logitech-mx-keys.py b/examples/logitech-mx-keys.py new file mode 100644 index 0000000..9dc682c --- /dev/null +++ b/examples/logitech-mx-keys.py @@ -0,0 +1,49 @@ +import shared +from lushlayers.config import Config, Device + +Config( + device=Device(vendor_id=1133, product_id=45915), + aliases=shared.aliases, + physical_layout=r""" + esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 ejct f13 f14 f15 f16 f17 f18 f19 + nubs 1 2 3 4 5 6 7 8 9 0 - = bspc ins home pgup nlck kp/ kp* kp- + tab q w e r t y u i o p [ ] ret del end pgdn kp7 kp8 kp9 kp+ + caps a s d f g h j k l ; ' \ kp4 kp5 kp6 + lsft ` z x c v b n m , . / rsft up kp1 kp2 kp3 + lctl lopt lcmd spc rcmd fn ropt left down rght kp0 kp. kprt + """, + layers=dict( + default=r""" + _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + esc _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + @nav _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ @sym _ _ _ _ _ _ _ _ _ _ _ + """, + navigation=r""" + _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ _ _ _ _ _ _ _ del _ _ _ _ _ _ _ + _ _ @cht @eml _ _ home @lwd @rwd end _ _ _ _ _ _ _ _ _ _ _ + _ @mus @www @trm @doc _ left down up rght _ _ _ _ _ _ _ + _ _ _ @vid @cal _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + """, + symbols=r""" + _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ ~ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ < { [ ( ` " ) ] } > _ _ _ _ _ _ + _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + """, + __template=r""" + _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + """, + ), +)