3 ms·
I use termdown to run timers in my terminal. Back when we only had a pressure cooker and couldn't afford an automatic rice cooker, I wrote a bash function "rice
by garfieldnate 4y ago
I use termdown to run timers in my terminal. Back when we only had a pressure cooker and couldn't afford an automatic rice cooker, I wrote a bash function "rice" that would give instructions for cooking it in the pressure cooker. Kinda silly in retrospect, but it did ease the pain of being broke a bit:
function alarm_forever() {
# play one part of the track at a time so that this function can be killed any time
while :; do
afplay --time .72 ~/sounds/alarm.mp3;
done
}
function alarm_until_input() {
alarm_forever &
pid=$!;
read -n 1 -p "$*";
kill -9 $pid;
}
# pip install termdown
function timer {
termdown $@;
alarm_until_input "[Press any key to stop]"
}
alias alarm="timer"
# TODO: ask if user soaked the rice first
function rice {
echo "1. Wash rice. Place in pressure cooker with 1-1 water-rice ratio."
echo "2. Place the pressure cooker on the stove on high."
read -n 1 -p "3. When the pressure pot starts whistling, press any key to start the timer."
termdown --title "Tweet!" 2m
alarm_until_input "4. Take pot off heat and press any key."
termdown --title "RICE" 11m
alarm_until_input "5. Open the pot and stir the rice immediately."
alarm_until_input "6. Eat!"
}