Skip to content
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

"Run a script" support (in addition to X11 and Wayland) #84

Open
pataquets opened this issue Jul 6, 2023 · 7 comments
Open

"Run a script" support (in addition to X11 and Wayland) #84

pataquets opened this issue Jul 6, 2023 · 7 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@pataquets
Copy link

pataquets commented Jul 6, 2023

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. 😄

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.

@pataquets pataquets added the enhancement New feature or request label Jul 6, 2023
@orhun
Copy link
Owner

orhun commented Jul 15, 2023

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?

@pataquets
Copy link
Author

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.

@orhun
Copy link
Owner

orhun commented Jul 31, 2023

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 🐻

@pataquets
Copy link
Author

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.

@pataquets
Copy link
Author

As I attempted to try custom_commands, I've filed #104.

@orhun
Copy link
Owner

orhun commented Aug 2, 2023

Making the X11 dependency optional would be a good start for this. What do you think?

@pataquets
Copy link
Author

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.

@orhun orhun added help wanted Extra attention is needed good first issue Good for newcomers labels Mar 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants