diff options
Diffstat (limited to '')
-rw-r--r-- | README.md | 45 | ||||
-rw-r--r-- | examples/skhdrc | 66 |
2 files changed, 66 insertions, 45 deletions
@@ -12,7 +12,7 @@ feature comparison between **skhd** and **khd** | hotkey passthrough | [x] | [x] | | modal hotkey-system | [x] | [x] | | use media-keys as hotkey | [x] | [ ] | -| application specific hotkey| [ ] | [x] | +| application specific hotkey| [x] | [x] | | modifier only hotkey | [ ] | [x] | | caps-lock as hotkey | [ ] | [x] | | mouse-buttons as hotkey | [ ] | [x] | @@ -72,35 +72,42 @@ A list of all built-in modifier and literal keywords can be found [here](https:/ A hotkey is written according to the following rules: ``` -hotkey = <mode> '<' <action> | <action> +hotkey = <mode> '<' <action> | <action> -mode = 'name of mode' | <mode> ',' <mode> +mode = 'name of mode' | <mode> ',' <mode> -action = <keysym> ':' <command> | <keysym> '->' ':' <command> - <keysym> ';' <mode> | <keysym> '->' ';' <mode> +action = <keysym> '[' <proc_map_lst> ']' | <keysym> '->' '[' <proc_map_lst> ']' + <keysym> ':' <command> | <keysym> '->' ':' <command> + <keysym> ';' <mode> | <keysym> '->' ';' <mode> -keysym = <mod> '-' <key> | <key> +keysym = <mod> '-' <key> | <key> -mod = 'modifier keyword' | <mod> '+' <mod> +mod = 'modifier keyword' | <mod> '+' <mod> -key = <literal> | <keycode> +key = <literal> | <keycode> -literal = 'single letter or built-in keyword' +literal = 'single letter or built-in keyword' -keycode = 'apple keyboard kVK_<Key> values (0x3C)' +keycode = 'apple keyboard kVK_<Key> values (0x3C)' --> = keypress is not consumed by skhd +proc_map_lst = * <proc_map> -command = command is executed through '$SHELL -c' and - follows valid shell syntax. if the $SHELL environment - variable is not set, it will default to '/bin/bash'. - when bash is used, the ';' delimeter can be specified - to chain commands. +proc_map = <string> ':' <command> - to allow a command to extend into multiple lines, - prepend '\' at the end of the previous line. +string = '"' 'sequence of characters' '"' - an EOL character signifies the end of the bind. +command = command is executed through '$SHELL -c' and + follows valid shell syntax. if the $SHELL environment + variable is not set, it will default to '/bin/bash'. + when bash is used, the ';' delimeter can be specified + to chain commands. + + to allow a command to extend into multiple lines, + prepend '\' at the end of the previous line. + + an EOL character signifies the end of the bind. + +-> = keypress is not consumed by skhd ``` A mode is declared according to the following rules: diff --git a/examples/skhdrc b/examples/skhdrc index c7658c2..5336e71 100644 --- a/examples/skhdrc +++ b/examples/skhdrc @@ -3,36 +3,42 @@ # # A hotkey is written according to the following rules: # -# hotkey = <mode> '<' <action> | <action> +# hotkey = <mode> '<' <action> | <action> # -# mode = 'name of mode' | <mode> ',' <mode> +# mode = 'name of mode' | <mode> ',' <mode> # -# action = <keysym> ':' <command> | <keysym> '->' ':' <command> -# <keysym> ';' <mode> | <keysym> '->' ';' <mode> +# action = <keysym> '[' <proc_map_lst> ']' | <keysym> '->' '[' <proc_map_lst> ']' +# <keysym> ':' <command> | <keysym> '->' ':' <command> +# <keysym> ';' <mode> | <keysym> '->' ';' <mode> # -# keysym = <mod> '-' <key> | <key> +# keysym = <mod> '-' <key> | <key> # -# mod = 'built-in mod keyword' | <mod> '+' <mod> +# mod = 'modifier keyword' | <mod> '+' <mod> # -# key = <literal> | <keycode> +# key = <literal> | <keycode> # -# literal = 'single letter or built-in keyword' +# literal = 'single letter or built-in keyword' # -# keycode = 'apple keyboard kVK_<Key> values (0x3C)' +# keycode = 'apple keyboard kVK_<Key> values (0x3C)' # -# -> = keypress is not consumed by skhd +# proc_map_lst = * <proc_map> # -# command = command is executed through '$SHELL -c' and -# follows valid shell syntax. if the $SHELL environment -# variable is not set, it will default to '/bin/bash'. -# when bash is used, the ';' delimeter can be specified -# to chain commands. +# proc_map = <string> ':' <command> # -# to allow a command to extend into multiple lines, -# prepend '\' at the end of the previous line. +# string = '"' 'sequence of characters' '"' # -# an EOL character signifies the end of the bind. +# command = command is executed through '$SHELL -c' and +# follows valid shell syntax. if the $SHELL environment +# variable is not set, it will default to '/bin/bash'. +# when bash is used, the ';' delimeter can be specified +# to chain commands. # +# to allow a command to extend into multiple lines, +# prepend '\' at the end of the previous line. +# +# an EOL character signifies the end of the bind. +# +# -> = keypress is not consumed by skhd # # NOTE(koekeishiya): A mode is declared according to the following rules: # @@ -43,16 +49,16 @@ # # @ = capture keypresses regardless of being bound to an action # -# command = command is executed through '$SHELL -c' and -# follows valid shell syntax. if the $SHELL environment -# variable is not set, it will default to '/bin/bash'. -# when bash is used, the ';' delimeter can be specified -# to chain commands. +# command = command is executed through '$SHELL -c' and +# follows valid shell syntax. if the $SHELL environment +# variable is not set, it will default to '/bin/bash'. +# when bash is used, the ';' delimeter can be specified +# to chain commands. # -# to allow a command to extend into multiple lines, -# prepend '\' at the end of the previous line. +# to allow a command to extend into multiple lines, +# prepend '\' at the end of the previous line. # -# an EOL character signifies the end of the bind. +# an EOL character signifies the end of the bind. # add an on_enter command to the default mode # :: default : chunkc border::color 0xff775759 @@ -69,6 +75,14 @@ # launch a new terminal instance when in either 'default' or 'test' mode # default, test < cmd - return : open -na /Applications/Terminal.app +# application specific bindings +# +# cmd - n [ +# "kitty" : echo "hello kitty" +# "qutebrowser" : echo "hello qutebrowser" +# "finder" : false +# ] + # open terminal, blazingly fast compared to iTerm/Hyper cmd - return : /Applications/Kitty.app/Contents/MacOS/kitty --single-instance -d ~ |