3 ms·
Sometimes when I wait for slow tasks to complete I do stuff like: sleep 900; say "Task X is probably done now" On Mac this works out of the box, AFAICT Linu
by cpach 2y ago
Sometimes when I wait for slow tasks to complete I do stuff like:
sleep 900; say "Task X is probably done now"
On Mac this works out of the box, AFAICT Linux has similar commands.
https://ss64.com/mac/say.html https://ss64.com/mac/say.html
https://manpages.debian.org/bookworm/gnustep-gui-common/say.1.en.html https://manpages.debian.org/bookworm/gnustep-gui-common/say....
- voytec 2y agoI use something similar with an added "nagging" functionality. Surprisingly, it's easier for me to obey this thing, than nagging from an actual human being. nagme () { [ "$#" -ne 2 ] && printf "usage: $0 [in_minutes] [text]\n" && return 1 printf "sleeping $1 min before telling you to $2\n" sleep "$(echo $1\*60|bc)" say "$2" > /dev/null 2>&1 while : do sleep 30 echo -n '.' say "I'm nagging you to $2" > /dev/null 2>&1 done }
- idontwantthis 2y agoI do this, but I put it after terminal tasks like builds or test suites like task build; say complete
- hobabaObama 2y agothank you. Just created an alias alias waitfor='f() { sleep $1; say "Task $2 is probably done now"; }; f'
- voytec 2y agoWhy an alias creating a function and running it, instead of just defining the waitfor() function? function waitfor(){ sleep $1; say "Task $2 is probably done now"; }
- louwrentius 2y agoI used this for my pipeline that deploys a fresly baked raspberry pi image onto an SD card. It would remind me to remove the SD card and put it in the Pi, boot it and have Ansible continue to configure it. Felt awesome.