MichaelAquilina / zsh-auto-notify

⏰ ZSH plugin that automatically sends out a notification when a long running task has completed.
GNU General Public License v3.0
415 stars 43 forks source link

ignored_commands.txt and don't show again button #65

Open stepanzak opened 3 months ago

stepanzak commented 3 months ago

Hi, it would be great if this plugin could read list of ignored commands from a file like ignored_commands.txt, with each ignored command on a new line. It would then be super easy to add a button on each zsh-auto-notify notification that would do echo %command>>ignored_commands.txt Most notification daemons support buttons out of the box. This might not seem like much, but it's a much better workflow than adding the ignored commands to variable in the config file - There are many commands you want to ignore, but it's impossible to remember all of them when writing the config. Adding each command to the config as you get the notification is even more annoying. This solution would be very quick and user friendly and satisfying - clicking on Don't show again for this command makes up for the annoying notification after exiting neovim.

stepanzak commented 3 months ago

Hi, I opened PR for the file-reading part, but notifications with buttons seems to be more complex. Turns out I can't just tell notify-send which command to execute on button click. I can only tell it codename of the button and it will print that codename into standard output when user clicks on that button. The best way to do that is in my opinion executing the notify-send command from another script, that then waits until notify-send finishes and based on it's output writes to the auto-notify-ignored.txt or not. Notify-send could theoretically run for hours if the user for example keeps hovering over the notification with mouse. That means the zsh script could also run for hours, which I think isn't optimal for the main script. Is it ok to try moving the part executing notify-send to separate script?