Skip to content

Keybindings

Format

samwm.bind("MODIFIERS", "KEY", "ACTION", "Description")
  • Modifiers: SUPER, ALT, CTRL, SHIFT (combine with +)
  • Key: XKB keysym name (letters, numbers, Return, Space, etc.)
  • Action: What happens when pressed
  • Description: For docs/waybar integration

Default Keybindings

Modifiers Key Action Description
SUPER Return exec terminal Open terminal
SUPER Q close Close 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
SUPER 1-5 workspace N Switch workspace
SUPER L layout next Next layout

Basic Actions

Action Description
close Close focused window
exit Exit SamWM
fullscreen Toggle fullscreen
togglefloating Toggle floating mode
exec CMD Execute shell command
workspace N Switch to workspace N

Focus Navigation

Action Description
focus next Focus next window
focus prev Focus previous window
focus up Focus window above
focus down Focus window below
focus left Focus window on left
focus right Focus window on right

Window Movement

Action Description
move up Move window up
move down Move window down
move left Move window left
move right Move window right
swap next Swap with next window
swap prev Swap with previous window

Resize Actions

Action Description
resize grow width Grow window width
resize shrink width Shrink window width
resize grow height Grow window height
resize shrink height Shrink window height
resize set W H Set exact size

Layout Actions

Action Description
layout next Switch to next layout
layout prev Switch to previous layout
layout master-stack Set master-stack layout
layout dwindle Set dwindle layout
layout bsp Set BSP layout
layout columns Set columns layout

Workspace Actions

Action Description
workspace N Switch to workspace N
workspace prev Previous workspace
workspace next Next workspace
movetoworkspace N Move window to workspace N

Multi-Monitor

Action Description
focus output Focus next monitor
workspace move output Move workspace to current monitor
window move output Move window to current monitor

Scratchpad

Action Description
scratchpad Toggle scratchpad
scratchpad show Show scratchpad
scratchpad hide Hide scratchpad

Key Names

Common key names:

  • Letters: A-Z
  • Numbers: 1-0
  • Navigation: Return, Space, Tab, Escape
  • Arrows: Up, Down, Left, Right
  • Function: F1-F12
  • Special: minus, equal, backslash, semicolon, apostrophe, grave

Modifiers

Combine modifiers with +:

samwm.bind("SUPER+SHIFT", "Q", "close", "Close window")
samwm.bind("SUPER+CTRL", "Return", "exec alacritty", "New terminal")