Sweets

Basic Configuration

Where your config lives, how it loads, and how to reload it

Sweets is configured in Lua.

Your file is ~/.config/sweets/sweets.lua. Create it with:

sweets --init-config
CommandResult
sweets --init-configCommented examples. Every default stays active.
sweets --init-config PATHWrites to PATH instead.

It never overwrites an existing file.

Put only what you want to change:

sweets.general({
    mod_key = "SUPER",
})

sweets.gaps({
    inner = 12,
    outer = 12,
})

sweets.bind("MOD+D", "spawn", { "fuzzel" })

Don't edit the installed .../share/sweets/sweets.lua. Updates replace it.

How your file is applied

Sweets loads the installed defaults first, then your file on top.

You writeResult
A section like sweets.gapsYour fields win. Fields you skip keep their default.
A key bindingReplaces the binding on the same keys.
sweets.unbind("MOD+Q")Removes a default binding.
Window rules, layer rules, exec_onceAdded after the defaults.

Each section, like sweets.general, can appear only once in your file.

Reload

Sweets reloads when you save. To reload by hand, press Super+Shift+R or run:

sweets msg reload

If your config has an error, Sweets keeps the last working one. The error shows at the top of every monitor until you fix it.

Check for errors

sweets --check-config

This checks your config without touching the running session.

Sandbox

Your config can use normal Lua: variables, functions, loops, tables, and the string, table, math, and utf8 libraries.

It can't read files or run commands. Use these instead:

Instead ofUse
requiresweets.include
os.executesweets.exec_once or a spawn binding

A misspelled name is an error, not nil. natural_scroll = falsed is rejected instead of silently ignored.

On this page