| wleave.json(5) | File Formats Manual | wleave.json(5) |
NAME
wleave.json - layout JSON file and configuration options
TOP-LEVEL-OPTIONS
The top-level options directly correspond to their long-version command-line option counter parts. Button layout is specified in the extra "button" field.
"buttons": <array of buttons>
"button-layout": <"grid">
"css": <string>
"service": <boolean>
Default: false
"buttons-per-row": <string>
Default: "3"
"column-spacing": <number / "<number>px" / "<number>%">
Default: "8px"
"row-spacing": <number / "<number>px" / "<number>%">
Default: "8px"
"margin": <number / "<number>px" / "<number>%">
Default: "20%" (of window size)
"margin-left" <number / "<number>px" / "<number>%">
Falls back to the value set by margin
"margin-right" <number / "<number>px" / "<number>%">
Falls back to the value set by margin
"margin-top" <number / "<number>px" / "<number>%">
Falls back to the value set by margin
"margin-bottom" <number / "<number>px" / "<number>%">
Falls back to the value set by margin
"button-aspect-ratio" <string or number>
If unspecified, the buttons fill all available space between the margins.
"close-on-lost-focus": <true/false>
Default: false
"show-keybinds": <true/false>
Default: false
"protocol": <"layer-shell"/"xdg"/"none">
Default: "layer-shell"
"no-version-info": <true/false>
Default: false
"delay-command-ms": <number>
Default: 100
LAYOUT
wleave buttons may have the following properties:
- "label" (string) - internal name of the button that can be used in CSS as an identifier
- "action" (command string or object or list thereof) - the action that will be executed via shell upon pressing the button
- "text" (string) - the visible label text of the button
- "keybind" (string) - a GTK key name associated with the button
- "icon" (path string) - filename to load an icon image from
- "height" (optional, number) - value in the range 0.0 to 1.0 to override the placement of the label in the button
- "width" (optional, number) - value in the range 0.0 to 1.0 to override the placement of the label in the button
- "circular" (optional, boolean, default false)
The action field can be an object with exactly one of `shell` or `executable` properties set. The `shell` action executes the given command in the system shell, while the `executable` action executes the specified binary, assuming it in `$PATH`. `executable` actions get filtered if the specified executable does not exist, allowing multiple possible options.
Any extra properties in the `action` objects are interpreted as filters. Currently, only environment variable filtering is implemented, where the values fields prefixed with `$` are matched as conditions for the given action.
The action field can also be an array where the first matching command is picked.
For example, in the following example, the `loginctl lock-session` command is executed on GNOME, while other desktop environments will try either `gtklock` or `swaylock` in that order.
"action": [
{
"$DESKTOP_SESSION": "gnome",
"shell": "loginctl lock-session"
},
{
"executable": "gtklock"
},
{
"executable": "swaylock"
} ]
FILE
Example file:
{
"close-on-lost-focus": true,
"show-keybinds": true,
"buttons-per-row": "1/1",
"buttons": [
{
"label": "lock",
"action": "swaylock",
"text": "Lock",
"keybind": "l",
"icon": "/usr/share/wleave/icons/lock.svg"
}
]
}
AUTHORS
Based on Wlogout by Haden Collins <collinshaden@gmail.com>. For more information about wlogout, see <https://github.com/ArtsyMacaw/wlogout>. Rewrite by Natty <natty.sh.git@gmail.com>, see <https://github.com/AMNatty/wleave>.
SEE ALSO
| 2026-10-16 |