sleep 2 && notify-send "Done"Show HN: Alert yourself after a long-running task in terminal
11–20 of 51 posts
On Gnome (via libnotify):
Re: Show HN: Alert yourself after a long-running task in terminal
#12Strange how many commenters misunderstood this. This alerts when any command runs for a long time, without having to modify the command itself.
Re: Show HN: Alert yourself after a long-running task in terminal
#13I just use printf \a for this.
Yep. "tput bel" is my version
Re: Show HN: Alert yourself after a long-running task in terminal
#14I wrote Notica (https://notica.us) to do something similar. It uses web browser notifications so it works on the servers you are SSH'd into and also to your phone.
Re: Show HN: Alert yourself after a long-running task in terminal
#15iTerm supports this! Take a look here: https://stackoverflow.com/questions/30016716/how-do-i-make-i...
`A + option + command` to be alerted on the next mark, which is basically when the new prompt appears.
Re: Show HN: Alert yourself after a long-running task in terminal
#16For Ubuntu/Gnome users, you can substitute `notify-send` for `terminal-notifier`, as linked.[1]
For WSL users, you can substitute a powershell call to BurntToast[2]
[1]https://gitlab.com/victor-engmark/tilde/-/commit/1fc8b9f6ab0...
Re: Show HN: Alert yourself after a long-running task in terminal
#17I hear that `terminal-notifier` is pretty much dead and a better replacement with new MacOS APIs is [0]. In any case, I opted against it because iTerm actually supports this natively, in addition to a few other neat features, and it will work over SSH. I wrote about my solution here [1].
[0] https://github.com/sheagcraig/yo [1] https://cgamesplay.com/post/2020/12/09/iterm-notifications/
Re: Show HN: Alert yourself after a long-running task in terminal
#18A lot of options here, so I'd like to add another :)
On cygwin/win10, I have an alias for 'wakeme', which under the hood uses Snoretoast, then I just append '; wakeme' to the command I run.
alias wakeme='date && /cygdrive/c/tools/snoretoast/snoretoast.exe -t "hello" -m "wake up" -p "C:\Dropbox\tools\mindblown.png" -s "ms-winsoundevent:Notification.Reminder"'
Re: Show HN: Alert yourself after a long-running task in terminal
#19This is great. Wanted to something about this for a long time. There are more features I desire: notify me when some string pattern occurs in the log. Also I tend to walk away from desk when I run a long program. So sometimes I'd prefer more aggressive notifications such as calling my cell.
Re: Show HN: Alert yourself after a long-running task in terminal
#20tput bel