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:
| Keys | Action |
|---|---|
MOD+1..9/0 | Switch to workspace 1–10 |
MOD+Shift+1..9/0 | Move 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")| Action | Result |
|---|---|
workspace_relative_next, workspace_relative_prev | Next or previous workspace |
workspace_move_relative_next, workspace_move_relative_prev | Move the window to the next or previous workspace |
workspace_empty | Go to the first empty workspace |
workspace_move_empty | Move the window to the first empty workspace |
workspace_previous | Go 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" })| Field | Default | Effect |
|---|---|---|
name | the number | Label shown in panels |
monitor | none | Pin to a monitor |
layout | layout.default | Starting layout |
master | layout.master | Master area size in percent, 10–90 |
master_count | layout.master_count | Number of master windows, 1–16 |
master_position | layout.master_position | Master side: "left", "right", "top", "bottom", or "auto" |
direction | scrolling.direction | Strip direction: "right", "left", "down", "up", or "auto" |
scrolling | monitor settings | Scrolling defaults for this workspace number |
open_as_floating | false | New windows open floating |
gaps, border, window | global values | Same 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")| Action | Result |
|---|---|
special_toggle | Show or hide the special workspace |
special_move | Send the focused window there |
special_next, special_prev | Show the next or previous window family |
special_all | Show 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