我通过终端开始了一个漫长的过程。进程完成后是否可以让 Ubuntu 终端发出声音?这样,我不需要继续检查,而是会通过声音收到通知。
每当运行超过 15 秒的命令在交互式 shell 中完成时,我都希望收到桌面通知。
换句话说,我希望所有命令都包含在这样的东西中
start=$(date +%s);
ORIGINAL_COMMAND;
[ $(($(date +%s) - start)) -le 15 ] || notify-send "Long running command finished"
Run Code Online (Sandbox Code Playgroud)
在 bash 中完成此任务的最佳方法是什么?