skhd

674 2026-08-08 note ♑︎

skhd is a simple hotkey daemon for macOS that runs in the background and executes commands when specific key combinations are pressed. It's commonly used with yabai to provide keyboard-driven window management.

Installation

brew install koekeishiya/formulae/skhd
brew services start skhd

Configuration

Configuration lives in ~/.config/skhd/skhdrc. The file is reloaded automatically when saved, or manually with:

skhd --reload

Basic Syntax

# Comments start with #
# Format: modifier + key = command
alt + return = exec open -n /Applications/Terminal.app

Modifiers

Keys

Common Patterns

Window Management with Yabai

# Focus windows
alt + h : yabai -m window --focus west
alt + j : yabai -m window --focus south
alt + k : yabai -m window --focus north
alt + l : yabai -m window --focus east

# Move windows
alt + shift + h : yabai -m window --warp west
alt + shift + j : yabai -m window --warp south
alt + shift + k : yabai -m window --warp north
alt + shift + l : yabai -m window --warp east

Application Launching

alt + return : exec open -n /Applications/Terminal.app
alt + b : exec open -a /Applications/Safari.app
alt + e : exec open -a /Applications/Visual\ Studio\ Code.app

Space Management

alt + 1 : yabai -m space --focus 1
alt + 2 : yabai -m space --focus 2
alt + 3 : yabai -m space --focus 3

Advanced Features

Multiple Commands

alt + t : exec terminal; exec say "terminal opened"

Conditional Execution

# Only run if yabai is running
alt + r : launch yabai -m window --focus && yabai -m window --focus next

Key Chords

# Press alt, then x, then c
alt > x > c : exec echo "key chord activated"

Mode Switching

# Define a mode
alt + m : mode launch
launch > a : exec open -a /Applications/AppStore.app
launch > s : exec open -a /Applications/Safari.app
launch > escape : mode default

Service Management

Command Action
brew services start skhd Start skhd service
brew services stop skhd Stop skhd service
brew services restart skhd Restart skhd service
skhd --reload Reload configuration without restart

Troubleshooting

Keys not working:

Configuration not loading:

Conflicts with macOS:

Sample Minimal Config

# Focus windows
alt + h : yabai -m window --focus west
alt + j : yabai -m window --focus south
alt + k : yabai -m window --focus north
alt + l : yabai -m window --focus east

# Move windows
alt + shift + h : yabai -m window --warp west
alt + shift + j : yabai -m window --warp south
alt + shift + k : yabai -m window --warp north
alt + shift + l : yabai -m window --warp east

# Resize windows
alt + r : yabai -m window --toggle zoom-parent
alt + e : yabai -m window --toggle split

# Float toggle
alt + space : yabai -m window --toggle float

# Restart yabai
alt + shift + r : launch yabai --restart-service

skhd is lightweight and fast—key presses are registered almost instantly, making it ideal for keyboard-driven workflows. The configuration is simple but powerful, enabling complex automation through keybindings.