Sweets

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,
})
FieldDefaultEffect
focus_follows_mousetrueMoving the pointer into a window focuses it
focus_follows_mouse_threshold0Pixels to move inside a window before it gets focus, 0–100
swallow_focus_clickfalseThe first click only focuses an unfocused window
follow_focustrueThe pointer jumps to a window you focus with the keyboard
follow_focus_restoretrueReturn to where the pointer was in that window. false centers it
follow_workspacetrueThe pointer moves to the window you were using after a workspace switch
follow_new_windowtrueThe pointer moves to a new window
follow_new_window_dialogsfalseAlso move to new dialogs
hide_when_followingfalseHide 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.

OptionDefaultEffect
size8Corner size in pixels, 1–256
delay0Milliseconds to stay inside the corner, 0–5000
monitorevery monitorOnly this monitor
fullscreenfalseAlso 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.

On this page