Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
JannisPetschenka committed Nov 12, 2023
1 parent 4c40781 commit 00fa5f5
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Table of Contents
* [Run](#run)
* [Control Center Shortcuts](#control-center-shortcuts)
* [Configuring](#configuring)
* [Toggle Buttons](#toggle-buttons)
* [Notification Inhibition](#notification-inhibition)
* [Scripting](#scripting)
* [Disable scripting](#disable-scripting)
Expand Down Expand Up @@ -242,6 +243,32 @@ to your `~/.config/swaync/` folder to customize without needing root access.
**Tip**: running swaync with `GTK_DEBUG=interactive swaync` will open a inspector
window that'll allow you to see all of the CSS classes + other information.

## Toggle Buttons

To add toggle buttons to your control center you can set the "type" in any acton to "toggle".
The toggle button supports different commands depending on the state of the button and
an "update_command" to update the state in case of changes from outside swaync. The update_command
is called every time the control center is opened/closed.
The active toggle button also gains the css-class ".toggle:checked"

`config.json` example:

```json
{
"buttons-gird": { // also works with actions in menubar widget
"actions": [
{
"label": "WiFi",
"type": "toggle",
"active": true,
"command": "sh -c '[[ $SWAYNC_TOGGLE_STATE == true ]] && nmcli radio wifi on || nmcli radio wifi off'",
"update_command": "sh -c '[[ $(nmcli radio wifi) == \"enabled\" ]] && echo true || echo false'"
}
]
}
}
```

## Notification Inhibition

Notifications can be inhibited through the provided `swaync-client` executable
Expand Down

0 comments on commit 00fa5f5

Please sign in to comment.