29
rated 0 times
[
29]
[
0]
/ answers: 1 / hits: 24766
/ 2 Years ago, wed, august 17, 2022, 5:43:32
I'd like to have a desktop notification whenever a command that has run for more than, say 15 seconds, finishes in an interactive shell.
In other words, I would like all commands to be wrapped in something like this
start=$(date +%s);
ORIGINAL_COMMAND;
[ $(($(date +%s) - start)) -le 15 ] || notify-send "Long running command finished"
What's the best way to accomplish this in bash?
More From » bash