GitHub - koekeishiya/skhd: Simple hotkey daemon for macOS
source link: https://github.com/koekeishiya/skhd
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
README.md
skhd is a simple hotkey daemon for macOS. It is a stripped version of khd (no longer maintained) (although rewritten from scratch), that sacrifices the more advanced features in favour of increased responsiveness and performance. skhd is able to hotload its config file, meaning that hotkeys can be edited and updated live while skhd is running.
feature comparison between skhd and khd
feature skhd khd hotload config file [x] [ ] hotkey passthrough [x] [x] modal hotkey-system [x] [x] application specific hotkey [x] [x] blacklist applications [x] [ ] use media-keys as hotkey [x] [ ] modifier only hotkey [ ] [x] caps-lock as hotkey [ ] [x] mouse-buttons as hotkey [ ] [x]Install
The first time skhd is ran, it will request access to the accessibility API.
After access has been granted, the application must be restarted.
Secure Keyboard Entry must be disabled for skhd to receive key-events.
Homebrew:
Requires xcode-8 command-line tools.
brew install koekeishiya/formulae/skhd
brew services start skhd
Source:
Requires xcode-8 command-line tools.
git clone https://github.com/koekeishiya/skhd
make install # release version
make # debug version
Usage
-V | --verbose: Output debug information
skhd -V
-P | --profile: Output profiling information
skhd -P
-v | --version: Print version number to stdout
skhd -v
-c | --config: Specify location of config file
skhd -c ~/.skhdrc
-k | --key: Synthesize a keypress (same syntax as when defining a hotkey)
skhd -k "shift + alt - 7"
-t | --text: Synthesize a line of text
skhd -t "hello, worldシ"
Configuration
skhd will load the configuration file $HOME/.skhdrc
, unless otherwise specified.
A sample config is available here
A list of all built-in modifier and literal keywords can be found here
A hotkey is written according to the following rules:
hotkey = <mode> '<' <action> | <action>
mode = 'name of mode' | <mode> ',' <mode>
action = <keysym> '[' <proc_map_lst> ']' | <keysym> '->' '[' <proc_map_lst> ']'
<keysym> ':' <command> | <keysym> '->' ':' <command>
<keysym> ';' <mode> | <keysym> '->' ';' <mode>
keysym = <mod> '-' <key> | <key>
mod = 'modifier keyword' | <mod> '+' <mod>
key = <literal> | <keycode>
literal = 'single letter or built-in keyword'
keycode = 'apple keyboard kVK_<Key> values (0x3C)'
proc_map_lst = * <proc_map>
proc_map = <string> ':' <command> | <string> '~' |
'*' ':' <command> | '*' '~'
string = '"' 'sequence of characters' '"'
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
* = matches every application not specified in <proc_map_lst>
~ = application is unbound and keypress is forwarded per usual, when specified in a <proc_map>
A mode is declared according to the following rules:
mode_decl = '::' <name> '@' ':' <command> | '::' <name> ':' <command> |
'::' <name> '@' | '::' <name>
name = desired name for this mode,
@ = 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.
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.
General options that configure the behaviour of skhd:
# specify a file that should be included as an additional config-file.
# treated as an absolutepath if the filename begins with '/' otherwise
# the file is relative to the path of the config-file it was loaded from.
.load "/Users/Koe/.config/partial_skhdrc"
.load "partial_skhdrc"
# prevents skhd from monitoring events for listed processes.
.blacklist [
"terminal"
"qutebrowser"
"kitty"
"google chrome"
]
Recommend
-
70
dotfiles - Configuration files
-
58
README.md Hotkey Behavior Trigger a action on element when keyboard hotkey is pressed. Automatically binds hotkeys to any link with a data...
-
91
README.md HotKey
-
56
README.md
-
423
README.md
-
1
吊炸天的 JD-hotkey !京东开源!单机 QPS 高达 370000发布于 8 月 6 日HotKey在618稳定版0.2版基础上,引入了protobuf序列化方式,并优化了传输对象。worke...
-
5
How to Create Taskbar and Hotkey Shortcuts for the Recycle Bin in Windows 11 By Jack Slater Published 14 hours ago Your...
-
6
Sublime: “Open Git Repository” Hotkey To open a Sublime Merge from a Sublime Text it is required to open a context menu with the right-click and select the “Open Git Repository”. By default, there is no a keyb...
-
9
从 2017 年暑假攒钱买了第一台 MacBook Pro 开始,我使用 macOS 已经五年了。随着工作学习需要,也逐渐开始使用多屏工作流。因为随时都需要开很多窗口,如 IDE、文本编辑工具、终端、IM 软件、邮件客户端等,稍没注意就很乱,得不停地切换来找到需要的窗口,很不方便...
-
9
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK