Sweets

Recent Windows

An Alt+Tab switcher over your most recently used windows

Hold a modifier and press a key to step through your windows, most recent first. Let go to switch.

sweets.bind("Alt+Tab", "recent_next")
sweets.bind("Alt+Shift+Tab", "recent_previous")
  • A quick Alt+Tab swaps between your last two windows.
  • Keep holding Alt and press Tab again to go further back.
  • Escape cancels. Return switches right away.
  • Picking a window hidden behind a fullscreen or maximized window ends that fullscreen or maximize. A taskbar click and sweets msg focus-window do the same. An app asking for focus by itself never does.

Close the highlighted window

sweets.bind("Alt+Delete", "close_recent_selection")

While holding Alt, press Delete to ask the highlighted window to close. Keep walking the list, or release Alt to switch. Apps can show a save dialog or refuse to close. Your normal close shortcut still closes the focused window.

This binding does nothing when the switcher is closed.

Which windows

Pass a scope to limit the list:

sweets.bind("Alt+Tab", "recent_next", "workspace")
sweets.bind("Alt+Shift+Tab", "recent_previous", "workspace")
ScopeWindows
"all"Every window (default)
"monitor"Windows on the current monitor
"workspace"Windows on the current workspace

To switch only between windows of the current app:

sweets.bind("Alt+grave", "recent_next", { scope = "all", filter = "app_id" })
sweets.bind("Alt+Shift+grave", "recent_previous", { scope = "all", filter = "app_id" })

sweets.recent_windows

sweets.recent_windows({
  style = "list",
  max_windows = 12,
  previews = false,
  open_delay = 150,
  font = "Sans 11",
  corner_radius = 12,
  selection_corner_radius = 8,
})
FieldDefaultEffect
enabledtruefalse turns the switcher off
style"list""list" for vertical rows or "icons" for a horizontal strip
previewsfalseShow the selected window's content
max_windows12Windows in the list, 1–64
open_delay150Milliseconds before the panel appears. A quick tap never shows it
debounce750Milliseconds a window must stay focused to count as recent. Typing or clicking counts at once
icon_size32Icon size, 0 hides icons
font"Sans 11"Font
background"#1C1F26F2"Panel color
text"#E6E9F0"Title color
secondary"#989FB0"App name color
selection"#4C7DFF"Highlight color
corner_radius0Outer panel radius, 0–64 logical pixels; 0 keeps square corners
selection_corner_radius0Highlight radius, 0–64 logical pixels; 0 keeps square corners

Windows that you only pass through briefly don't move up the list, thanks to debounce. Set it to 0 to count every focus.

Icons use published pixels first, then the theme or desktop entry. Choose the shared theme with general.icon_theme.

Horizontal icons

Choose style = "icons" for a horizontal row of large icons:

sweets.recent_windows({
  style = "icons",
  icon_size = 64,
  corner_radius = 16,
  selection_corner_radius = 12,
})

Each window gets its own tile. The caption shows the highlighted window's title and app. When the row overflows, it scrolls with the selection and edge arrows mark hidden windows.

Missing icons show the app's initial; icon_size = 0 gives text-only tiles. With previews = true, the preview appears below the caption when space allows.

On this page