"Run a script" support (in addition to X11 and Wayland)
Is your feature request related to a problem? Please describe. Trying to get ~desktop~ terminal notifications from programs emitting them in a headless, no desktop (neither X nor Wayland) TTY-only environment (remote shells). I can launch a headless DBus service for programs requiring it (ie. failing if no DBus present). Also, this opens up a world of extensibility, where you can get creative with notification methods. :smile:
Describe the solution you'd like Just an 'invoke a custom script' backend in addition to X11 and Wayland, which would handle all notifications. It could be 'in addition to' X11 or 'replacing' X11. I guess that a 'script-only' backend would enable adding fancy functionality to any Desktop Environment, without requiring to drop the built-in notification manager. (e.g. send a push notification to Android/iOS).
Describe alternatives you've considered A specific software just listening for DBus notifications, but found none.
Hey, thanks for creating this issue. I would like to hear more about your ideas, especially the part that how you think this could be implemented. As far as I understood, you simply want a command-line interface that listens D-Bus notifications and you want to utilize it in shell scripts, am I right? Can you give a concrete example of that?
Thanks for your interest, @orhun. Invoking a script would serve almost infinite use cases, users could get creative. Mine would be to be able to send notifications to a tmux floating popup or a tmux display message. However, lots of use cases could be enabled. Just stretching a bit more, you could, for instance, send notifications to:
- A text-to-speech device
- Some signaling hardware (home automation LEDs, etc)
- Push notifications
- Whatever other crazy idea you might come up...
It would also enable to have desktop notifications, on bare TTY sessions, since you can run a DBus session without X11 and sending & listening notifications just needs DBus.
Yeah, I can totally see the potential of this feature and it would be amazing to have it!
Regarding the implementation/usage, do you have an idea of how it would look like? Is it going to be a binary listening for events? How is it going to be configured?
I'm just trying to grasp better what is on your mind 🐻
Having to code a listening program would place it out of reach/convenience for the average user.
I was thinking more in an external program/script that would be invoked on each event, specified with a simple --script command line switch or config file option. I'm not sure about if it would replace or add to X11 notifications (ie. as another backend).
Looking closely to the docs, maybe my use case could be covered with a custom_command which could unconditionally send all events to tmux.
However, replacing X11 could be useful for some users. Maybe if exit codes from filters were checked for stopping/continuing processing would work for those users. Not sure, thou.
As I attempted to try custom_commands, I've filed #104.
Making the X11 dependency optional would be a good start for this. What do you think?
Not a must for my specific use case, but I guess that it won't hurt when adding Wayland support. Having the X11/Wayland code outside the main logic as a sort of backend, would later enable to add a no-X-just-script backend as we're discussing here. Disclaimer: I'm not familiar with the codebase, neither with Rust.