-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for multiple instances of Waybar to exclude multiple notifications #23
Comments
@jlaunay do you have this problem? |
No, I have two monitors, and whether it's on Sway or Hyprland, notifications never appear twice. |
Same here, @AlxTray do you use the latest version? Also could you maybe add some details? |
Hey, thanks for replying. I'm on the non-git package from the AUR, and sources are just pacman and AUR, no devel. I do have the module on both waybars, so it seems that it probably is just a waybar thing, with it making multiple processes. |
AFAIK yes, waybar still has a bug when it leaves orphan processes after own restart. Killing process manually should probably help. Please confirm after testing. |
Hey, yeah I am able to kill the processes manually. But I am also getting this upon startup. Though moving forward I’m going to just have the module on my primary monitor as either way this seems like a consequence of waybar itself, as weirdly enough if I’m to create a module that just executes “checkupdates | wc -l” on both waybars, only 1 waybar actually gets the line count. |
Oh, I got it. Waybar starts Unfortunately this will be a major overhaul and should be better entirely rewritten to something better suited than Bash (Go, Python, or at least nushell?). I will keep it open, maybe at somepoint I will have some time to do it. |
...or adding a command line option to disable notifications, on first bar exec as usual and on the second exec with notifications disabled. |
Well, yes, but in that case |
Yeah, sounds good. It could be a nice addition to just have an argument that just disables notifications outright though. Thanks for taking your time to help |
I would use it only as a temporary workaround, you could easily apply it by hand. By upstreaming this change no one will know it's even a problem, unless they will read code for some reason. Hope you understand my point! |
Completely agree, I hadn't thought about that at all and just focused on the issue of not generating a second notification. |
Simple approach: create a background service from the current script, but instead of posting json updates to stdout, post them to temporary file (by replacing content, not appending). Write a new "client" script which will just read this file and post it to own stdout from which Waybar will get new statuses. Notifications will be still handled by current script, but it will has only one instance in that case. |
I was actually just thinking of making a quick hacky solution of creating a service, having it print to stdout and then reading from journalctl on the waybar side. But that is a lot better lol |
You idea is also nice, but I don't think running 2-3 instances of |
Yeah, definitely would not be a good permanent solution |
I am personally don't have a lot of time right now, also I am currently using laptop with GNOME cause I moved to another country recently. If you want, you could try to prepare MR, @AlxTray. In my opinion it should not be hard. |
For notifications to work it should be a user service, otherwise it will unable to connect session d-bus I guess. |
Yeah, I don’t mind giving it a go at some point, probably will have to be over the weekend though |
Yeah, that's a good-enough solution for now. Thanks for setting that up |
A possible solution would be to start a systemd user service that broadcasts output of I am not an expert in bash, but I think this can be accomplished via # Server-side
dbus-send --session --type=signal / com.example.waybar_updates.notify_client string:"<content>"
# Client-side
dbus-monitor "interface='com.example.waybar_updates',member='notify_client'" The client would then need to grep the output of dbus-monitor for the |
I'm not too sure if there is a way of fixing this but currently a desktop notification is sent per waybar update, so with 2 monitors, 2 sets of notifications are sent.
The text was updated successfully, but these errors were encountered: