Created
October 18, 2021 19:23
-
-
Save eparadis/b4d2e36022854a545bb1d9d766513793 to your computer and use it in GitHub Desktop.
a script that writes to a text file that you can use in OBS for an on-screen meeting timer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ $# -ne 1 ]]; then | |
echo "Usage: ./meeting_countdown.sh NUM_MINS" | |
exit 1 | |
fi | |
MINS=$1 | |
OUTFILE=~/src/obs/timer_out.txt | |
MESSAGE="time remaining in this meeting: " | |
for i in `seq $(($MINS*60)) 1` | |
do | |
sleep 1 | |
MIN_REMAINING=$((i / 60)) | |
SEC_REMAINING=$((i - ( $MIN_REMAINING * 60 ) )) | |
printf "$MESSAGE %d:%0.2d" $MIN_REMAINING $SEC_REMAINING > $OUTFILE | |
done | |
while test 1; do | |
sleep 1; echo "$MESSAGE None." > $OUTFILE | |
sleep 1; echo "$MESSAGE nOne." > $OUTFILE | |
sleep 1; echo "$MESSAGE noNe." > $OUTFILE | |
sleep 1; echo "$MESSAGE nonE." > $OUTFILE | |
sleep 1; echo "$MESSAGE none_" > $OUTFILE | |
done |
Hey look: months later I actually came back to use this on another computer. Yay me!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Because this uses
sleep
for all its timing, it isn't particularly accurate. It is fine for meetings up to an hour long, and if you've got meetings longer than that, you've got other problems.The animated "none" at the end is intentionally kind of annoying so that folks notice that time is up without being super obtrusive.
I've gotten a few suggestions:
say
to make the announcement audibleNo one has asked for it but obviously it would be very cool if this somehow got the next meeting's end time directly from your calendar somehow.
These are left as an exercise to the reader.