ErikReider / SwayNotificationCenter

A simple GTK based notification daemon for SwayWM
GNU General Public License v3.0
1.17k stars 60 forks source link

Issue #141: Waybar subscription missed opportunity #142

Closed carlosV2 closed 2 years ago

carlosV2 commented 2 years ago

This PR includes the number of notifications in the text field when swaync-client is called with waybar subscription. (Issue #141)

With this PR, the output of the command becomes like this (please, note the text field being non-empty now):

{"text": "1", "alt": "notification", "tooltip": "1 Notification", "class": "notification"}
{"text": "2", "alt": "notification", "tooltip": "2 Notifications", "class": "notification"}
{"text": "2", "alt": "notification", "tooltip": "2 Notifications", "class": ["notification", "cc-open"]}
{"text": "2", "alt": "notification", "tooltip": "2 Notifications", "class": ["notification", "cc-open"]}
{"text": "1", "alt": "notification", "tooltip": "1 Notification", "class": ["notification", "cc-open"]}
{"text": "0", "alt": "none", "tooltip": "", "class": ["none", "cc-open"]}
{"text": "0", "alt": "none", "tooltip": "", "class": ["none", "cc-open"]}
{"text": "0", "alt": "none", "tooltip": "", "class": ["none", "cc-open"]}
{"text": "0", "alt": "none", "tooltip": "", "class": "none"}
...

P.S.: I couldn't find tests for this feature. Are there any?

Thank you!

ErikReider commented 2 years ago

I sadly haven't had any time to write any tests at all :(

ErikReider commented 2 years ago

A update to the README would be good too :)

carlosV2 commented 2 years ago

Ok, I've added a little something to the README.

I've also tried to fix the linting issue but because I've never worked with vala before, I'm not sure I've fixed it or made it worse... let's see (to be honest, I wasn't sure what the error really was 😅). The code definitely works as I've manually tested it and, let's be honest, my contribution is not rocket science anyway 😂.

carlosV2 commented 2 years ago

Ok, done!

All you said makes sense. I didn't realise the parenthesis had an space leading them. Anyway, it should work now 😄

carlosV2 commented 1 year ago

Out of curiosity, what is the process this needs to follow until it ends in a linux distro? Arch to be more precise

ErikReider commented 1 year ago

Atm it's only officially supported in the AUR. I'm actually not sure about that... I'll maybe check it out if I have some spare time. It would be nice to only need to maintain the swaync-git PKGBUILD instead of maintaining both (if that's even how it works...). I'll open an issue :)

carlosV2 commented 1 year ago

Ah ok, cool. Thanks for your work!