Issue #141: Waybar subscription missed opportunity (#142)

* add notifications number in text field

* include a mention about this in the README

* fix the linting issue... hopefully

* print the count as a uint directly
This commit is contained in:
Carlos Ortega 2022-07-10 10:40:19 +01:00 committed by GitHub
parent 440ca813c7
commit b455c63479
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View File

@ -215,6 +215,15 @@ Waybar css file
}
```
Alternatively, the number of notifications can be shown by adding `{}` anywhere in the `format` field in the Waybar config
```json
"custom/notification": {
"format": "{} {icon}",
...
},
```
## Screenshots
![Screenshot of desktop notification](./assets/desktop.png)

View File

@ -88,8 +88,8 @@ private void on_subscribe_waybar (uint count, bool dnd, bool cc_open) {
}
print (
"{\"text\": \"\", \"alt\": \"%s\", \"tooltip\": \"%s\", \"class\": %s}\n",
state, tooltip, _class);
"{\"text\": \"%u\", \"alt\": \"%s\", \"tooltip\": \"%s\", \"class\": %s}\n",
count, state, tooltip, _class);
}
private void print_subscribe_waybar () {