From b7bbd626ebfdfc0b27b89d18abec5ba65310b783 Mon Sep 17 00:00:00 2001 From: koekeishiya Date: Sun, 7 Jan 2018 19:51:44 +0100 Subject: #15 update readme and sample config --- README.md | 44 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 10 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 597fa18..9b8cc59 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,6 @@ **skhd** is a simple hotkey daemon for macOS. It is a stripped version of [**khd**](https://github.com/koekeishiya/khd) (although rewritten from scratch), that sacrifices the more advanced features in favour of increased responsiveness and performance. - -**skhd** uses a subset of the grammar that **khd** uses. In other words, **khd** is able to load and run **skhd** config files without having -to make any changes to the file. This makes it very simple to migrate between **skhd** and **khd** on demand. - **skhd** is able to hotload its config file, meaning that hotkeys can be edited and updated live while **skhd** is running. **skhd** has an improved parser that is able to accurately identify both the line and character position of any symbol that does not @@ -17,11 +13,10 @@ feature comparison between **skhd** and **khd** | feature | skhd | khd | |:--------------------------:|:----:|:---:| | hotload config file | [x] | [ ] | -| store hotkey in hashmap | [x] | [ ] | -| store hotkey in linked-list| [ ] | [x] | +| store hotkeys in hashmap | [x] | [ ] | | require unix domain socket | [ ] | [x] | | hotkey passthrough | [x] | [x] | -| modal hotkey-system | [ ] | [x] | +| modal hotkey-system | [x] | [x] | | application specific hotkey| [ ] | [x] | | modifier only hotkey | [ ] | [x] | | caps-lock as hotkey | [ ] | [x] | @@ -76,12 +71,16 @@ 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 = ':' | - '->' ':' +hotkey = '<' | + +mode = 'name of mode' | ',' + +action = ':' | '->' ':' + ';' | '->' ';' keysym = '-' | -mod = 'built-in mod keyword' | '+' +mod = 'modifier keyword' | '+' key = | @@ -102,3 +101,28 @@ command = command is executed through '$SHELL -c' and an EOL character signifies the end of the bind. ``` + +A mode can be defined in two different ways: +``` +# define mode 'switcher' with an on_enter command +:: switcher : chunkc border::color 0xff24ccaa + +# define modes without an on_enter command +:: swap +:: focus +``` + +Modal sample: +``` +# defines a new mode named 'test' +:: test + +# from 'default' mode, activate mode 'test' +cmd - x ; test + +# from 'test' mode, activate mode 'default' +test < cmd - x ; default + +# launch a new terminal instance when in either 'default' or 'test' mode +default, test < cmd - return : open -na /Applications/Terminal.app +``` -- cgit v1.2.3