rua icon indicating copy to clipboard operation
rua copied to clipboard

notify user (X11) on missing upgrades

Open vn971 opened this issue 4 years ago • 2 comments

Idea: create a framework to notify user on possible upgrades. E.g. a graphical notification on login.

Implementation proposal:

  • when a user upgrades AUR via rua upgrade, propose to install the notification. Possible choices would be "Yes, No, Never".
  • for a "Yes" answer, an XDG entry will be created in autostart (~/.config/autostart by default). This will be launch-able on login, and trigger X11 notification for missing upgrades (if any).
  • for a "No" answer from user, nothing is done
  • for a "Never" answer form the user, an XDG entry is created with Hidden=true. This stops any kind of execution from XDG, but an XDG autostart manager will be able to see this entry, and the user can still change it in future.
  • the "Yes/No/Never" dialog will not be shown for the user if XDG rua.desktop file already exists. Be it Hidden=true, Hidden=false or whatever else.

Request for comments: if there are considerations against such "Never" behavior or it feels privacy violating in any way, please share. I hope it's not, because nothing is ever executed in this scenario.

The XDG entry, if created and enabled, would call a subcommand rua notify-upgrades-x11 (might be hidden to not clutter the help), which would behave exactly as rua upgrade --printonly, only it will trigger an X11 notification instead of printing to console.

This is only an idea for now, feel free to propose other solutions / comment. Thoughts?

vn971 avatar Mar 31 '20 08:03 vn971

To me this sounds like the job for another program.

The XDG entry, if created and enabled, would call a subcommand rua notify-upgrades-x11 (might be hidden to not clutter the help), which would behave exactly as rua upgrade --printonly, only it will trigger an X11 notification instead of printing to console.

If anything, rua upgrade could have an option to offer the --printonly information in a more programmatically accessible format (tabs and newline separation?), which such an additional notification tool could consume.

qoh avatar May 06 '20 04:05 qoh

Yeah, it could be another program as well. But you can have such a program independently already, there are no restrictions for that. I just want any simple solution that would bring actual X11 notifications for the user -- whatever that'll be, presuming it's secure, maintainable and not privacy-invasive.

an option to offer the --printonly information in a more programmatically accessible format

But that is already the case, isn't it?:

$ rua upgrade --printonly 2>/dev/null
packageA
packageB

Packages separated by newline. Consumable by other scripts, should one build an X11 notification, or something completely different, on their own.

vn971 avatar May 06 '20 06:05 vn971