buzz / volctl

Per-application volume control and OSD for Linux desktops.
https://buzz.github.io/volctl/
GNU General Public License v2.0
132 stars 19 forks source link

[Feature Request] Not start volctl if instance is already running #57

Closed paulhersch closed 3 years ago

paulhersch commented 3 years ago

As the title says If i have an instance of volctl running i would like to have volctl not run a second time. I have volctl in the startup script of my WM and reloading the config usually starts volctl a second time.

raven2cz commented 3 years ago

I don't know if buzz will implement this feature. But you can write your bash script which ensures correct launch of volctl.

This trick can find the volctl instance and wait for killing it.

# Terminate already running bar instances
killall -q volctl
# Wait until the processes have been shut down
while pgrep -u $UID -x volctl >/dev/null; do sleep 1; done

If you need whole script, I can try to write it. Or is it enough for you?

paulhersch commented 3 years ago

Thank You! This is enough for me It is a workaround for now then i guess (until the feature gets implemented (hopefully))

pijulius commented 3 years ago

If I may vote contra this, what if I want to start two separate instances, one on display 0 and one on display 1. I think being able to run as many instances as I want is better as you can always kill the old instance if you don't want this to happen.

raven2cz commented 3 years ago

Yes, and it is a reason why it is implemented by this way. Several *nix services are provided by this way. If someone need to lead just one instance, the easy script handles this, like my simple example, or create appropriate systemd service to control singleton initalization only.

paulhersch commented 3 years ago

Script method works, no need for ony having one instance running