Skip to content

Commit

Permalink
Issue #141: Waybar subscription missed opportunity (#142)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
carlosV2 authored Jul 10, 2022
1 parent 440ca81 commit b455c63
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/client.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down

0 comments on commit b455c63

Please sign in to comment.