ErikReider / SwayNotificationCenter

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

Support for synchonous notifications #86

Closed Dorian-DS closed 2 years ago

Dorian-DS commented 2 years ago

I have volume change notifications, however, they don't seem to work as intended with notify-send when using -h string:x-canonical-private-synchronous:volume

This should replace the old notification with a new one so that I don't get a whole bunch of volume change notifications. Instead is should just appear to change while on screen.

ErikReider commented 2 years ago

Could you send a link to your script?

ErikReider commented 2 years ago

Related to #56

Dorian-DS commented 2 years ago

Could you send a link to your script?

Here's an example line in my sway/config bindsym XF86AudioRaiseVolume exec amixer -q set Master 1%+ unmute ; exec notify-send "Volume $(awk '/%/ { print $5}' <(pactl get-sink-volume 51))" -h string:x-canonical-private-synchronous:volume

Another simpler test is running this; notify-send "test" -h string:x-canonical-private-synchronous:test

Running it multiple times in a row makes a popup appear each time, intead of it appearing once and being replaced.

Running mako as a notifier with the code in sway/config will make it appear only once as intended, with the volume percentage changing each time the keybind is pressed, without multiple notifications appearing.

ErikReider commented 2 years ago

I'll look into this :)