phuhl / notify-send.py

A python-script like libnotify but with improved functionality
Other
95 stars 13 forks source link

--replaces-process fails when keeping triggering button pressed #11

Open Schmoho opened 4 years ago

Schmoho commented 4 years ago

Obviously this is an integration issue, so I'll have to mention some context on other programs, I hope you'll bear with me.

The setup is using sxhkd with the following rule:

XF86AudioLowerVolume
    volcontrol.sh dec

with volcontrol.sh being

#!/bin/sh
if [ "$1" == "dec" ]; then
    pamixer -d 5
fi

VOLUME=$(pamixer --get-volume)

notify-send.py "Volume" "$VOLUME%" \
                         --hint boolean:transient:true \
                         --replaces-process "volume-popup"

You noted on --replaces-process "If called with this parameter notify-send.py might block, best to be called with a trailing &." so I tried both variants, behaviour is the same.

When I keep XF86AudioLowerVolume pressed for a while and then release it, I get a stack of notifications by deadd-notification-center.

I can only assume this is due to some state management issue, i.e. this seems relevant: notify_send_py.py#L114

Unfortunately I can't really judge in what way this is most appropriately solved or even just what the actual problem seems to be.

I noticed that in your .dotfiles repo you use a script deadd-volume-dec, I can only assume that's basically what's showcased on the deadd github-page?

I'd appreciate any input as to if that is a somewhat familiar problem.

phuhl commented 3 years ago

Hi, thanks for reporting.

I am aware of a similar behavior, where it sometimes prints multiple notifications. But for me it doesn't seem like it is caused by holding the volume button pressed (and thus sending multiple notis in rapid succession) but something else, I am not aware of.

I noticed that in your .dotfiles repo you use a script deadd-volume-dec, I can only assume that's basically what's showcased on the deadd github-page? Yup, usually works for me, with the quirk described above.

I don't have a better clue here, than you, sadly. If you find out more about it, feel free to comment or open a PR :)

phuhl commented 3 years ago

And sorry for the late reply