Sweets

General

Modifier key, background, workspaces, and cross-monitor behavior

sweets.general sets global behavior. Set only the fields you want to change.

sweets.general({
  mod_key = "SUPER",
  background = "#12121c",
  workspace_count = 10,
  workspace_move_follow = true,
})

Options

FieldDefaultEffect
"SUPER"What MOD means in bindings: "SUPER" or "ALT"
unsetMOD when Sweets runs inside another desktop
"#06080A"Solid, gradient, radial or layered background
background_artworkSweets logoCentered SVG artwork, or false to hide it
"hicolor"Theme for switcher and tab icons; false disables fallback
"shared""shared" or "per_monitor" workspaces
10Number of workspaces, 1–10
"select""swap" brings a workspace from another monitor to this one
falseFollow a window you move to another workspace
falsePressing the current workspace's key goes back to the previous one
falseNext/previous workspace wraps around
falseNext/previous workspace skips empty ones
trueDirectional focus continues onto the next monitor
falseKeep directional focus aligned instead of falling back diagonally
exit_cover_on_openboth falseLet a new window leave maximize or fullscreen
trueDirectional moves continue onto the next monitor
trueCenter a dragged tiled window under the pointer
falseRight-click during a move to choose tiled or floating placement
offSnap floating windows to edges
falseResize by dragging a border
8Extra grab area outside the border, 0–64 pixels
"#C27AFF80"Show where a dragged window lands, or false
trueOpen apps where you launched them
quit_timeout30Seconds to wait for applications to close when quitting, 1–120
30Seconds an app has to claim its launch settings, 1–600
primary_selectiontrueMiddle-click paste between apps
15Frame rate for render_unfocused windows, 1–60
"disable_panel"What closing the laptop lid does
"system"Who handles the power key
unsetCommand to restart a crashed screen locker

The installed config sets background = "#12121c".

Backgrounds

Choose a solid colour, gradient, radial or layered background. Changes apply on save. Wallpaper apps cover these backgrounds.

Solid:

sweets.general({ background = "#12121c" })

Gradient blends four corners:

sweets.general({
    background = {
        mode = "gradient",
        top_left = "#A85BFF",
        top_right = "#39B8FF",
        bottom_left = "#6FE2FF",
        bottom_right = "#6F4CFF",
    },
})

Radial blends from centre to edge:

sweets.general({
    background = {
        mode = "radial",
        center = "#373057",
        edge = "#1F1B2E",
        center_x = 50,
        center_y = 50,
        radius = 100,
    },
})

Layered adds soft colour blobs over a base:

sweets.general({
    background = {
        mode = "layered",
        base = "#12121c",
        blobs = {
            { color = "#FFFFFF", opacity = 16, x = 18, y = 12, radius = 90 },
            { color = "#7C4DFF", opacity = 35, x = 82, y = 78, radius = 120 },
        },
    },
})

The base can be a colour or a solid, gradient or radial table. Use up to eight blobs. Later blobs appear on top.

All values below are integer percentages:

FieldDefaultRange
center_x, center_y500–100, from the left and top
Blob x, y500–100, from the left and top
radius1001–400, relative to half the monitor's shorter edge
Blob opacity1000–100

Gradient, radial and layered bases must be opaque. Solid and blob colours also accept alpha (#RRGGBBAA). Blob opacity multiplies colour alpha.

A monitor's background overrides general.background:

sweets.monitor("DP-1", {
    background = { mode = "radial", center = "#373057", edge = "#1F1B2E" },
})

Background artwork

A small Sweets logo appears in the center of each monitor. Wallpaper apps cover it wherever their background is opaque.

Use your own SVG:

sweets.general({
    background_artwork = {
        source = "~/.config/sweets/mark.svg",
        width = 220,
        opacity = 25,
    },
})
FieldDefaultEffect
source"builtin:sweets"Built-in logo or a local .svg file
width220Width in logical pixels, 8–1024; keeps proportions and shrinks to fit
opacity25Opacity from 0–100 percent

Hide the artwork with sweets.general({ background_artwork = false }). An empty table restores the default logo, size and opacity.

Relative paths start beside your sweets.lua. Saving your SVG updates the artwork too. Invalid changes keep your last working configuration. SVG text must be converted to paths, embedded images are unsupported.

mod_key

sweets.general({ mod_key = "ALT" })
sweets.bind("MOD+Return", "spawn", { "foot" })  -- Alt+Return

Bindings that name Super or Alt directly don't change.

Running Sweets in a window inside another desktop? Set mod_key_nested = "ALT" so your host desktop keeps the Super key.

workspace_mode

ValueBehavior
"shared"One set of workspaces for all monitors. Picking a workspace shown on another monitor focuses that monitor.
"per_monitor"Each monitor has its own workspaces 1–10.

To pin a workspace to a monitor, see Workspaces.

If you lower workspace_count, keep your workspace bindings in range:

sweets.general({ workspace_count = 5 })

for i = 1, 5 do
  sweets.bind("MOD+" .. i, "workspace", i)
  sweets.bind("MOD+Shift+" .. i, "workspace_move", i)
end

drag_center_cursor

When you MOD+drag a tiled window, it centers under the pointer. Set false to keep the spot you grabbed. Floating windows always keep the spot you grabbed.

drag_toggle_floating

sweets.general({ drag_toggle_floating = true })

While holding MOD+left-drag, right-click to switch between tiled and floating. Release the left button to place the window. Off by default.

snap

Floating windows snap to screen edges and other floating windows while you drag or resize them.

sweets.general({
  snap = { enabled = true, monitor_gap = 10, window_gap = 10, respect_gaps = false },
})
FieldDefaultEffect
enabledfalseTurn snapping on
monitor_gap10Snap distance to screen edges in pixels, 0 turns it off
window_gap10Snap distance to other windows, 0 turns it off
respect_gapsfalseLeave your gaps instead of snapping flush

Windows snap to the usable area, so they never land under a panel.

resize_on_border

Drag a window's border to resize it, no modifier needed.

sweets.general({
  resize_on_border = true,
  resize_border_grab = 8,
})

resize_border_grab makes the grab area wider than the border itself. It never steals clicks from apps or panels.

insert_hint

While you drag a tiled window, a colored box shows where it will land. For tab drags, a line shows the insertion position. Setting this to false hides both previews.

sweets.general({ insert_hint = "#C27AFF80" })
sweets.general({ insert_hint = { "#C27AFF80", "#7AA2F780", angle = 90 } })
sweets.general({ insert_hint = false })

It takes the same colors as a border.

exit_cover_on_open

Set maximized = true to return a maximized window to the normal layout when a new window opens and takes focus on that workspace.

sweets.general({ exit_cover_on_open = { maximized = true } })

Set fullscreen = true to enable the same behavior for fullscreen windows.

spawn_origin_placement

An app opens on the workspace where you launched it, even if you switched away while it was starting.

It works with apps that support XDG_ACTIVATION_TOKEN, such as GTK 4 apps and foot. Other apps open where you are. A window rule's workspace or monitor still wins.

Turning this off keeps explicit launch settings active.

lid_switch

ValueEffect
"disable_panel"Closing the lid turns off the laptop screen and moves its windows to other monitors
"none"The lid doesn't change your screens

With no other monitor attached, the laptop screen stays on.

To run a command on lid close, use a switch binding.

power_key

By default, the power key turns the computer off. To bind it yourself:

sweets.general({ power_key = "compositor" })
sweets.bind("XF86PowerOff", "spawn", { "veila", "lock" })
ValueEffect
"system"The system handles the key and powers off
"compositor"Only your binding runs

With "compositor" and no XF86PowerOff binding, the power key does nothing.

This needs systemd-logind.

Application icons

Set icon_theme to an installed theme name, such as "Papirus". Sweets checks inherited themes, then hicolor. Published icon pixels take priority. Missing pixels use the icon name or desktop entry. PNG and SVG icons are supported.

On this page