On Gnome (via libnotify): sleep 2 && notify-send "Done"
notify-send can be installed with the ruby-notify package.
41–50 of 51 posts
On Gnome (via libnotify): sleep 2 && notify-send "Done"
notify-send can be installed with the ruby-notify package.
Personally I have a flask app deployed on heroku that posts a message to a Discord webhook just by visiting an url. So in my case when I use ssh to run long tasks I have at the end "curl https:// .herokuapp.com/?Finished" and as soon as that commands is executed I receive a message either at my phone or computer (through a channel in a personal discord server). Probably is a bit of a 'hacky' way, and using different…
This seems a little over complicated since curl itself could just post to discord.
But personally I made it for two reasons: no need to know the discord webhook api (a long alphanumeric url) nor the json required, so I can use it wherever I want without having to remember almost anything; and as a url to be able to use it from any internet-connected thing, not only with curl, even the browser if you want.
I use `noti` for this: `some_task && noti` `noti some_task` both work. https://github.com/variadico/noti
On Gnome (via libnotify): sleep 2 && notify-send "Done"
ps: maybe sem-related: for things that I want to run a long time ad want them to use less cpu while they do for whatever reason (like overheating), I wrote a bash script I called "verynice" that makes everything in the same process group as the program it executes, all go to sleep for N seconds, then wakes/runs them again for M seconds afterward, in a loop. And when it finishes, (ie, the sleep/wake target not running any more), it exits. Then the typeahead noted above could finally execute and beep or pop up a message.
Here is it for fish, using the postexec event handler: function postexec_notify --arg cmd --on-event fish_postexec set -l s $pipestatus if test "$CMD_DURATION" -ge 25000 && ! string match -rq '(^man|\s--help)(\s|$)' $cmd if string match "$status" -qv 0 $s terminal-notifier -title $cmd -message 'Exited with '(string join '|' $s)' after '(math $CMD_DURATION / 1000)s else terminal-notifier -title $cmd -message 'Finished…
- Using a zsh plugin, it works for every command that I run, but only if I need it, so it doesn't create extra noise. Meaning, it is automatically activated for terminals that go out of focus. I don't need a special suffix to activate it. I recently contributed a tmux pull request just for that [1].
- It's a fixed size, flashing window in a side monitor, so if I got off the chair after execution started, I still notice the termination when I return to my workstation.
- If I change my focus back to the unfocused terminal where the termination happened, the notification disappear by itself (no extra action needing to click the 'x'!).
- It contains information regarding the tmux pane in which the termination has happened. This is needed, because I have multiple tmux sessions each having multiple windows with multiple panes in it, and all this on top of multiple XFCE workspaces.
- It's a server-client architecture, so clients running on separate host shells can run on a different computer and am able to send over termination notifications to the server that hosts the GUI (my workstation desktop).