Keybindings
SamWM supports configurable keybindings via the Lua configuration file.
Default Keybindings
| Modifiers | Key | Action | Description |
|---|---|---|---|
| SUPER | Return | exec terminal | Open terminal |
| SUPER | Q | close | Close focused window |
| SUPER | M | exit | Exit SamWM |
| SUPER | J | focus next | Focus next window |
| SUPER | K | focus prev | Focus previous window |
| SUPER | F | fullscreen | Toggle fullscreen |
| SUPER | Space | togglefloating | Toggle floating mode |
| SUPER | 1-5 | workspace N | Switch to workspace N |
Available Actions
| Action | Arguments | Description |
|---|---|---|
close |
none | Close the focused window |
exit |
none | Exit the compositor |
fullscreen |
none | Toggle fullscreen for focused window |
togglefloating |
none | Toggle floating mode for focused window |
focus next |
none | Focus the next window in the stack |
focus prev |
none | Focus the previous window in the stack |
workspace N |
N (1-10) | Switch to workspace N |
exec CMD |
shell command | Execute a shell command |
Modifier Keys
| Name | Description |
|---|---|
SUPER |
Super/Windows/Meta key |
ALT |
Alt key |
CTRL |
Control key |
SHIFT |
Shift key |
Custom Keybindings
Add custom keybindings in your config.lua:
samwm.bind("SUPER", "Return", "exec alacritty")
samwm.bind("SUPER+SHIFT", "Q", "exec firefox")
samwm.bind("ALT", "Tab", "focus next")Note: Currently only single modifiers are supported. Multi-modifier support is planned.
Key Names
Key names follow XKB keysym names. Common keys:
- Letters:
AthroughZ - Numbers:
1through0 Return,Space,Tab,Escape,BackSpaceUp,Down,Left,RightF1throughF12Insert,Delete,Home,End,Page_Up,Page_Down