Created
December 7, 2022 22:11
-
-
Save sbliven/e1c3eed56bcda83090662affa5d78971 to your computer and use it in GitHub Desktop.
Karabiner Elements script to use Fn-<key> for emojis and unicode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/zsh | |
| # Restores the clipboard after running unicode_fn.sh | |
| export LC_ALL='en_US.UTF-8' | |
| export LANG='en_US.UTF-8' | |
| sleep .1 | |
| pbpaste -pboard ruler | pbcopy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "title": "Unicode letters", | |
| "rules": [ | |
| { | |
| "description": "Unicode letters with Fn", | |
| "manipulators": [ | |
| { | |
| "type": "basic", | |
| "from": { | |
| "key_code": "a", | |
| "modifiers": { | |
| "mandatory": [ | |
| "fn" | |
| ] | |
| } | |
| }, | |
| "to": [ | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/unicode_fn.sh.sh a" | |
| } | |
| ], | |
| "to_delayed_action": { | |
| "to_if_invoked": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ], | |
| "to_if_canceled": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ] | |
| }, | |
| "parameters": { | |
| "basic.to_delayed_action_delay_milliseconds": 100 | |
| } | |
| }, | |
| { | |
| "type": "basic", | |
| "from": { | |
| "key_code": "b", | |
| "modifiers": { | |
| "mandatory": [ | |
| "fn" | |
| ] | |
| } | |
| }, | |
| "to": [ | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/unicode_fn.sh.sh b" | |
| } | |
| ], | |
| "to_delayed_action": { | |
| "to_if_invoked": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ], | |
| "to_if_canceled": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ] | |
| }, | |
| "parameters": { | |
| "basic.to_delayed_action_delay_milliseconds": 100 | |
| } | |
| }, | |
| { | |
| "type": "basic", | |
| "from": { | |
| "key_code": "c", | |
| "modifiers": { | |
| "mandatory": [ | |
| "fn" | |
| ] | |
| } | |
| }, | |
| "to": [ | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/unicode_fn.sh.sh c" | |
| } | |
| ], | |
| "to_delayed_action": { | |
| "to_if_invoked": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ], | |
| "to_if_canceled": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ] | |
| }, | |
| "parameters": { | |
| "basic.to_delayed_action_delay_milliseconds": 100 | |
| } | |
| }, | |
| { | |
| "type": "basic", | |
| "from": { | |
| "key_code": "d", | |
| "modifiers": { | |
| "mandatory": [ | |
| "fn" | |
| ] | |
| } | |
| }, | |
| "to": [ | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/unicode_fn.sh.sh d" | |
| } | |
| ], | |
| "to_delayed_action": { | |
| "to_if_invoked": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ], | |
| "to_if_canceled": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ] | |
| }, | |
| "parameters": { | |
| "basic.to_delayed_action_delay_milliseconds": 100 | |
| } | |
| }, | |
| { | |
| "type": "basic", | |
| "from": { | |
| "key_code": "e", | |
| "modifiers": { | |
| "mandatory": [ | |
| "fn" | |
| ] | |
| } | |
| }, | |
| "to": [ | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/unicode_fn.sh.sh e" | |
| } | |
| ], | |
| "to_delayed_action": { | |
| "to_if_invoked": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ], | |
| "to_if_canceled": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ] | |
| }, | |
| "parameters": { | |
| "basic.to_delayed_action_delay_milliseconds": 100 | |
| } | |
| }, | |
| { | |
| "type": "basic", | |
| "from": { | |
| "key_code": "f", | |
| "modifiers": { | |
| "mandatory": [ | |
| "fn" | |
| ] | |
| } | |
| }, | |
| "to": [ | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/unicode_fn.sh.sh f" | |
| } | |
| ], | |
| "to_delayed_action": { | |
| "to_if_invoked": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ], | |
| "to_if_canceled": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ] | |
| }, | |
| "parameters": { | |
| "basic.to_delayed_action_delay_milliseconds": 100 | |
| } | |
| }, | |
| { | |
| "type": "basic", | |
| "from": { | |
| "key_code": "g", | |
| "modifiers": { | |
| "mandatory": [ | |
| "fn" | |
| ] | |
| } | |
| }, | |
| "to": [ | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/unicode_fn.sh.sh g" | |
| } | |
| ], | |
| "to_delayed_action": { | |
| "to_if_invoked": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ], | |
| "to_if_canceled": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ] | |
| }, | |
| "parameters": { | |
| "basic.to_delayed_action_delay_milliseconds": 100 | |
| } | |
| }, | |
| { | |
| "type": "basic", | |
| "from": { | |
| "key_code": "h", | |
| "modifiers": { | |
| "mandatory": [ | |
| "fn" | |
| ] | |
| } | |
| }, | |
| "to": [ | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/unicode_fn.sh.sh h" | |
| } | |
| ], | |
| "to_delayed_action": { | |
| "to_if_invoked": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ], | |
| "to_if_canceled": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ] | |
| }, | |
| "parameters": { | |
| "basic.to_delayed_action_delay_milliseconds": 100 | |
| } | |
| }, | |
| { | |
| "type": "basic", | |
| "from": { | |
| "key_code": "i", | |
| "modifiers": { | |
| "mandatory": [ | |
| "fn" | |
| ] | |
| } | |
| }, | |
| "to": [ | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/unicode_fn.sh.sh i" | |
| } | |
| ], | |
| "to_delayed_action": { | |
| "to_if_invoked": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ], | |
| "to_if_canceled": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ] | |
| }, | |
| "parameters": { | |
| "basic.to_delayed_action_delay_milliseconds": 100 | |
| } | |
| }, | |
| { | |
| "type": "basic", | |
| "from": { | |
| "key_code": "j", | |
| "modifiers": { | |
| "mandatory": [ | |
| "fn" | |
| ] | |
| } | |
| }, | |
| "to": [ | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/unicode_fn.sh.sh j" | |
| } | |
| ], | |
| "to_delayed_action": { | |
| "to_if_invoked": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ], | |
| "to_if_canceled": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ] | |
| }, | |
| "parameters": { | |
| "basic.to_delayed_action_delay_milliseconds": 100 | |
| } | |
| }, | |
| { | |
| "type": "basic", | |
| "from": { | |
| "key_code": "k", | |
| "modifiers": { | |
| "mandatory": [ | |
| "fn" | |
| ] | |
| } | |
| }, | |
| "to": [ | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/unicode_fn.sh.sh k" | |
| } | |
| ], | |
| "to_delayed_action": { | |
| "to_if_invoked": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ], | |
| "to_if_canceled": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ] | |
| }, | |
| "parameters": { | |
| "basic.to_delayed_action_delay_milliseconds": 100 | |
| } | |
| }, | |
| { | |
| "type": "basic", | |
| "from": { | |
| "key_code": "l", | |
| "modifiers": { | |
| "mandatory": [ | |
| "fn" | |
| ] | |
| } | |
| }, | |
| "to": [ | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/unicode_fn.sh.sh l" | |
| } | |
| ], | |
| "to_delayed_action": { | |
| "to_if_invoked": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ], | |
| "to_if_canceled": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ] | |
| }, | |
| "parameters": { | |
| "basic.to_delayed_action_delay_milliseconds": 100 | |
| } | |
| }, | |
| { | |
| "type": "basic", | |
| "from": { | |
| "key_code": "m", | |
| "modifiers": { | |
| "mandatory": [ | |
| "fn" | |
| ] | |
| } | |
| }, | |
| "to": [ | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/unicode_fn.sh.sh m" | |
| } | |
| ], | |
| "to_delayed_action": { | |
| "to_if_invoked": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ], | |
| "to_if_canceled": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ] | |
| }, | |
| "parameters": { | |
| "basic.to_delayed_action_delay_milliseconds": 100 | |
| } | |
| }, | |
| { | |
| "type": "basic", | |
| "from": { | |
| "key_code": "n", | |
| "modifiers": { | |
| "mandatory": [ | |
| "fn" | |
| ] | |
| } | |
| }, | |
| "to": [ | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/unicode_fn.sh.sh n" | |
| } | |
| ], | |
| "to_delayed_action": { | |
| "to_if_invoked": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ], | |
| "to_if_canceled": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ] | |
| }, | |
| "parameters": { | |
| "basic.to_delayed_action_delay_milliseconds": 100 | |
| } | |
| }, | |
| { | |
| "type": "basic", | |
| "from": { | |
| "key_code": "o", | |
| "modifiers": { | |
| "mandatory": [ | |
| "fn" | |
| ] | |
| } | |
| }, | |
| "to": [ | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/unicode_fn.sh.sh o" | |
| } | |
| ], | |
| "to_delayed_action": { | |
| "to_if_invoked": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ], | |
| "to_if_canceled": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ] | |
| }, | |
| "parameters": { | |
| "basic.to_delayed_action_delay_milliseconds": 100 | |
| } | |
| }, | |
| { | |
| "type": "basic", | |
| "from": { | |
| "key_code": "p", | |
| "modifiers": { | |
| "mandatory": [ | |
| "fn" | |
| ] | |
| } | |
| }, | |
| "to": [ | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/unicode_fn.sh.sh p" | |
| } | |
| ], | |
| "to_delayed_action": { | |
| "to_if_invoked": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ], | |
| "to_if_canceled": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ] | |
| }, | |
| "parameters": { | |
| "basic.to_delayed_action_delay_milliseconds": 100 | |
| } | |
| }, | |
| { | |
| "type": "basic", | |
| "from": { | |
| "key_code": "q", | |
| "modifiers": { | |
| "mandatory": [ | |
| "fn" | |
| ] | |
| } | |
| }, | |
| "to": [ | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/unicode_fn.sh.sh q" | |
| } | |
| ], | |
| "to_delayed_action": { | |
| "to_if_invoked": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ], | |
| "to_if_canceled": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ] | |
| }, | |
| "parameters": { | |
| "basic.to_delayed_action_delay_milliseconds": 100 | |
| } | |
| }, | |
| { | |
| "type": "basic", | |
| "from": { | |
| "key_code": "r", | |
| "modifiers": { | |
| "mandatory": [ | |
| "fn" | |
| ] | |
| } | |
| }, | |
| "to": [ | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/unicode_fn.sh.sh r" | |
| } | |
| ], | |
| "to_delayed_action": { | |
| "to_if_invoked": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ], | |
| "to_if_canceled": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ] | |
| }, | |
| "parameters": { | |
| "basic.to_delayed_action_delay_milliseconds": 100 | |
| } | |
| }, | |
| { | |
| "type": "basic", | |
| "from": { | |
| "key_code": "s", | |
| "modifiers": { | |
| "mandatory": [ | |
| "fn" | |
| ] | |
| } | |
| }, | |
| "to": [ | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/unicode_fn.sh.sh s" | |
| } | |
| ], | |
| "to_delayed_action": { | |
| "to_if_invoked": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ], | |
| "to_if_canceled": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ] | |
| }, | |
| "parameters": { | |
| "basic.to_delayed_action_delay_milliseconds": 100 | |
| } | |
| }, | |
| { | |
| "type": "basic", | |
| "from": { | |
| "key_code": "t", | |
| "modifiers": { | |
| "mandatory": [ | |
| "fn" | |
| ] | |
| } | |
| }, | |
| "to": [ | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/unicode_fn.sh.sh t" | |
| } | |
| ], | |
| "to_delayed_action": { | |
| "to_if_invoked": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ], | |
| "to_if_canceled": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ] | |
| }, | |
| "parameters": { | |
| "basic.to_delayed_action_delay_milliseconds": 100 | |
| } | |
| }, | |
| { | |
| "type": "basic", | |
| "from": { | |
| "key_code": "u", | |
| "modifiers": { | |
| "mandatory": [ | |
| "fn" | |
| ] | |
| } | |
| }, | |
| "to": [ | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/unicode_fn.sh.sh u" | |
| } | |
| ], | |
| "to_delayed_action": { | |
| "to_if_invoked": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ], | |
| "to_if_canceled": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ] | |
| }, | |
| "parameters": { | |
| "basic.to_delayed_action_delay_milliseconds": 100 | |
| } | |
| }, | |
| { | |
| "type": "basic", | |
| "from": { | |
| "key_code": "v", | |
| "modifiers": { | |
| "mandatory": [ | |
| "fn" | |
| ] | |
| } | |
| }, | |
| "to": [ | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/unicode_fn.sh.sh v" | |
| } | |
| ], | |
| "to_delayed_action": { | |
| "to_if_invoked": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ], | |
| "to_if_canceled": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ] | |
| }, | |
| "parameters": { | |
| "basic.to_delayed_action_delay_milliseconds": 100 | |
| } | |
| }, | |
| { | |
| "type": "basic", | |
| "from": { | |
| "key_code": "w", | |
| "modifiers": { | |
| "mandatory": [ | |
| "fn" | |
| ] | |
| } | |
| }, | |
| "to": [ | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/unicode_fn.sh.sh w" | |
| } | |
| ], | |
| "to_delayed_action": { | |
| "to_if_invoked": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ], | |
| "to_if_canceled": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ] | |
| }, | |
| "parameters": { | |
| "basic.to_delayed_action_delay_milliseconds": 100 | |
| } | |
| }, | |
| { | |
| "type": "basic", | |
| "from": { | |
| "key_code": "x", | |
| "modifiers": { | |
| "mandatory": [ | |
| "fn" | |
| ] | |
| } | |
| }, | |
| "to": [ | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/unicode_fn.sh.sh x" | |
| } | |
| ], | |
| "to_delayed_action": { | |
| "to_if_invoked": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ], | |
| "to_if_canceled": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ] | |
| }, | |
| "parameters": { | |
| "basic.to_delayed_action_delay_milliseconds": 100 | |
| } | |
| }, | |
| { | |
| "type": "basic", | |
| "from": { | |
| "key_code": "y", | |
| "modifiers": { | |
| "mandatory": [ | |
| "fn" | |
| ] | |
| } | |
| }, | |
| "to": [ | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/unicode_fn.sh.sh y" | |
| } | |
| ], | |
| "to_delayed_action": { | |
| "to_if_invoked": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ], | |
| "to_if_canceled": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ] | |
| }, | |
| "parameters": { | |
| "basic.to_delayed_action_delay_milliseconds": 100 | |
| } | |
| }, | |
| { | |
| "type": "basic", | |
| "from": { | |
| "key_code": "z", | |
| "modifiers": { | |
| "mandatory": [ | |
| "fn" | |
| ] | |
| } | |
| }, | |
| "to": [ | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/unicode_fn.sh.sh z" | |
| } | |
| ], | |
| "to_delayed_action": { | |
| "to_if_invoked": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ], | |
| "to_if_canceled": [ | |
| { | |
| "key_code": "v", | |
| "modifiers": "command" | |
| }, | |
| { | |
| "shell_command": "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| } | |
| ] | |
| }, | |
| "parameters": { | |
| "basic.to_delayed_action_delay_milliseconds": 100 | |
| } | |
| } | |
| ] | |
| } | |
| ] | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """Generator script | |
| usage: python unicode_fn.py > unicode_fn.json | |
| """ | |
| import json | |
| import sys | |
| keys = [chr(ord('a')+i) for i in range(26)] | |
| activate_script = "~/.config/karabiner/assets/complex_modifications/unicode_fn.sh" | |
| restore_script = "~/.config/karabiner/assets/complex_modifications/restore_pb.sh" | |
| def make_rules(): | |
| restore = [ | |
| {"key_code": "v", "modifiers": "command"}, | |
| {"shell_command": restore_script}, | |
| ] | |
| manipulators = [] | |
| for key in keys: | |
| manipulators.append({ | |
| "type": "basic", | |
| "from": { | |
| "key_code": key, | |
| "modifiers": { | |
| "mandatory": ["fn"], | |
| } | |
| }, | |
| "to": [ | |
| {"shell_command": activate_script + " " + key} | |
| ], | |
| "to_delayed_action": { | |
| "to_if_invoked": restore, | |
| "to_if_canceled": restore, | |
| }, | |
| "parameters": { | |
| "basic.to_delayed_action_delay_milliseconds": 100 | |
| }, | |
| }) | |
| return { | |
| "title": "Unicode letters", | |
| "rules": [ | |
| { | |
| "description": "Unicode letters with Fn", | |
| "manipulators": manipulators, | |
| } | |
| ] | |
| } | |
| if __name__ == "__main__": | |
| json.dump(make_rules(), sys.stdout, indent=2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/zsh | |
| # Copies unicode character to clipboard | |
| # usage: unicode_fn.sh <key> | |
| export LC_ALL='en_US.UTF-8' | |
| export LANG='en_US.UTF-8' | |
| # Customize character for each key below | |
| # Can be unicode directly or unicode hex points, eg 1D70C | |
| typeset -A unicode_characters=( a 'πΌ' b 'π½' c 'π' | |
| d 'πΏ' e 'π' f 'π' | |
| g 'πΎ' h 'π' i 'π' | |
| j 'π' k 'π ' l 'π' | |
| m 'π' n 'π' o 'π' | |
| p 'π' q 'π' r 'π' | |
| s 'π' t 'π' u 'π' | |
| v 'π' w 'π' x 'π' | |
| y 'π' z 'π' | |
| ) | |
| key="$1" | |
| echo -n "$key " >> ~/kb_test | |
| date >> ~/kb_test | |
| # Copy current clipboard content to 'ruler' pboard | |
| pbpaste | pbcopy -pboard ruler && | |
| printf "\\U${unicode_characters[${key:-a}]}" | pbcopy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment