Pointer
Focus follows mouse, pointer follows focus, and hot corners
sweets.pointer sets how focus and the mouse pointer follow each other.
sweets.pointer({
focus_follows_mouse = true,
follow_focus = true,
follow_workspace = true,
})| Field | Default | Effect |
|---|---|---|
focus_follows_mouse | true | Moving the pointer into a window focuses it |
focus_follows_mouse_threshold | 0 | Pixels to move inside a window before it gets focus, 0–100 |
swallow_focus_click | false | The first click only focuses an unfocused window |
follow_focus | true | The pointer jumps to a window you focus with the keyboard |
follow_focus_restore | true | Return to where the pointer was in that window. false centers it |
follow_workspace | true | The pointer moves to the window you were using after a workspace switch |
follow_new_window | true | The pointer moves to a new window |
follow_new_window_dialogs | false | Also move to new dialogs |
hide_when_following | false | Hide the cursor after it jumps, until you move the mouse |
These defaults come from the installed config.
Click to focus
sweets.pointer({ focus_follows_mouse = false })Now only a click focuses a window.
To focus without also clicking the window’s content:
sweets.pointer({
focus_follows_mouse = false,
swallow_focus_click = true,
})The next click reaches the window normally. Mouse bindings and tab buttons keep their usual behavior.
To keep focus follows mouse but ignore brushing past a window, set a small threshold:
sweets.pointer({ focus_follows_mouse_threshold = 8 })To skip hover focus for one window, use
focus_on_hover = false in a window rule.
Hot corners
Run an action when the pointer hits a screen corner:
sweets.hot_corner("top-left", "toggle_overview", nil, { delay = 300 })
sweets.hot_corner("bottom-right", "spawn", { "fuzzel" }, { size = 4 })
sweets.hot_corner("top-right", "workspace_relative_next", nil, { monitor = "DP-1" })Corners are top-left, top-right, bottom-left, and bottom-right. Any
key binding action works. If the
action takes no argument, pass nil before the options.
| Option | Default | Effect |
|---|---|---|
size | 8 | Corner size in pixels, 1–256 |
delay | 0 | Milliseconds to stay inside the corner, 0–5000 |
monitor | every monitor | Only this monitor |
fullscreen | false | Also trigger over fullscreen windows |
A corner triggers once per entry. With a delay, leaving early cancels the action.
During a native Wayland file drag, a corner set directly to toggle_overview
can open Overview.
Other corner actions wait until the drag ends and you enter the corner again.