Sweets

Workspaces

Numbered workspaces, monitor pins, switching, and moving windows

Sweets has workspaces 1 to 10. Set how many you want and how they work across monitors in General.

sweets.workspace sets options for one workspace number.

Switching and moving

The installed config already binds these:

KeysAction
MOD+1..9/0Switch to workspace 1–10
MOD+Shift+1..9/0Move the window to workspace 1–10

More workspace actions:

sweets.bind("MOD+Page_Down", "workspace_relative_next")
sweets.bind("MOD+Page_Up", "workspace_relative_prev")
sweets.bind("MOD+N", "workspace_empty")
sweets.bind("MOD+Shift+N", "workspace_move_empty")
ActionResult
workspace_relative_next, workspace_relative_prevNext or previous workspace
workspace_move_relative_next, workspace_move_relative_prevMove the window to the next or previous workspace
workspace_emptyGo to the first empty workspace
workspace_move_emptyMove the window to the first empty workspace
workspace_previousGo back to the last workspace

Follow a moved window

Use follow = true to go with the window, or follow = false to stay put.

sweets.bind("MOD+Ctrl+3", "workspace_move", 3, { follow = true })
sweets.bind("MOD+Ctrl+Shift+3", "workspace_move", 3, { follow = false })

follow also works on individual column, relative, and empty-workspace move bindings. A binding without it uses workspace_move_follow. For a tap-and-hold binding, it applies to the tap action.

Move a scrolling column

sweets.bind("MOD+Alt+Shift+2", "workspace_move_column", 2)

This moves every window in the focused scrolling column, including minimized windows and hidden tabs

Launch an app on an empty workspace

sweets.bind("MOD+2", "workspace", 2, {
  spawn = { "firefox" },
  cooldown = 1000,
})

Firefox starts only when workspace 2 is empty. cooldown stops a second launch while it loads.

To always open an app on a workspace, use a window rule:

sweets.window_rule({ app_id = "org.mozilla.firefox", workspace = 2 })

Pinning a workspace to a monitor

sweets.workspace(1, { name = "web", monitor = "eDP-1" })
sweets.workspace(4, { name = "code", monitor = "DP-1" })
sweets.workspace(2, { monitor = { make = "DEL", model = "S2719DGF" } })

monitor takes a connector name or the make, model, and serial from sweets msg outputs. A pinned workspace always opens on that monitor. If the monitor is unplugged, the workspace moves back when it returns.

List monitors in order of preference for different docks:

sweets.workspace(1, { monitor = {
    { make = "DEL", serial = "HOME1" }, "DP-1", "eDP-1"
} })

The first connected, enabled monitor wins. The workspace returns when a preferred monitor reconnects. Use one to eight choices, without duplicates.

name is the label panels show. Bindings still use the number.

Layout and appearance

sweets.workspace(3, {
  layout = "monocle",
  gaps = { inner = 0, outer = 0 },
  border = { width = 0 },
  window = { corner_radius = 0 },
})
sweets.workspace(2, { layout = "tile", master = 65, master_count = 2, master_position = "top" })
sweets.workspace(5, { layout = "scrolling", direction = "down" })
FieldDefaultEffect
namethe numberLabel shown in panels
monitornonePin to a monitor
layoutlayout.defaultStarting layout
masterlayout.masterMaster area size in percent, 10–90
master_countlayout.master_countNumber of master windows, 1–16
master_positionlayout.master_positionMaster side: "left", "right", "top", "bottom", or "auto"
directionscrolling.directionStrip direction: "right", "left", "down", "up", or "auto"
scrollingmonitor settingsScrolling defaults for this workspace number
open_as_floatingfalseNew windows open floating
gaps, border, windowglobal valuesSame fields as sweets.layout_style

In per_monitor mode, each numbered rule applies on every monitor. reset_layout restores the active layout’s settings from the workspace rule.

A window rule's floating setting wins over open_as_floating.

Named scratchpads

Floating tools you summon with one key are covered in Scratchpads.

Special workspaces

Special workspaces show a collection of windows over your desktop.

sweets.bind("MOD+S", "special_toggle")
sweets.bind("MOD+Shift+S", "special_move")

sweets.bind("MOD+Ctrl+M", "special_toggle", "music")
sweets.bind("MOD+Ctrl+Shift+M", "special_move", "music")
ActionResult
special_toggleShow or hide the special workspace
special_moveSend the focused window there
special_next, special_prevShow the next or previous window family
special_allShow every window in the special workspace
  • Give a name to keep several separate ones, up to 16.
  • Only one shows at a time.
  • New windows open in it while it's shown.

Cycle windows in a special workspace

Keep several utilities together and show one at a time:

sweets.bind("MOD+Ctrl+F9", "special_next", "tools")
sweets.bind("MOD+Ctrl+F10", "special_prev", "tools")
sweets.bind("MOD+Ctrl+F11", "special_all", "tools")

New independent windows join without replacing the selected family. If its root closes, moves away or is minimized, Sweets selects the next eligible family.

Launch an app in a special workspace

sweets.bind("MOD+grave", "special_toggle", "notes", {
  spawn = { "foot", "--app-id", "notes" },
  cooldown = 1000,
})

The first press starts foot in the notes special workspace. After that, the key just shows and hides it.

Change the dimmer and blur behind special workspaces with sweets.special.

From the terminal

sweets msg workspaces
sweets msg switch-workspace 4
sweets msg move-to-workspace 4
sweets msg special-toggle music

On this page