swaymsg
swaymsg debugging and inspection commands.
Inspect
List all inputs (keyboards, mice, touchpad, wacom):
swaymsg -t get_inputsList all outputs (monitors):
swaymsg -t get_outputsFull window tree (find app_id, titles):
swaymsg -t get_treeFind app_id of a specific window:
swaymsg -t get_tree | grep -i app_id -A2 -B2Find a specific window (e.g. pavucontrol):
swaymsg -t get_tree | grep -A10 "pavucontrol"Get current config:
swaymsg -t get_configFind swayidle in config:
swaymsg -t get_config | grep swayidle -nCheck scroll_factor:
swaymsg -t get_inputs | grep scroll_factor
Control
Reload sway config + restart waybar:
swaymsg reload(or$mod+Shift+c)Kill focused window:
swaymsg -t command killMove workspace to output:
swaymsg workspace 2 output "Lenovo Group Limited P24h-10 VTN45266"Toggle DPMS (display on/off):
swaymsg output eDP-1 dpms offswaymsg output eDP-1 dpms on
Debugging window rules
To check what app_id/title a window has (for for_window rules):
swaymsg -t get_tree | grep -i app_id -A2 -B2
Or use xprop for XWayland windows (reports WM_CLASS instead):
xprop | grep WM_CLASS # click the window