Skip to content

Instantly share code, notes, and snippets.

@eparadis
Created October 18, 2021 19:23
Show Gist options
  • Save eparadis/b4d2e36022854a545bb1d9d766513793 to your computer and use it in GitHub Desktop.
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
#!/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
@eparadis
Copy link
Author

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:

  • use an actual end time so that it's more accurate
  • announce when the meeting has 5 minutes left
  • use say to make the announcement audible
  • get rid of that annoying ending animation ;)

No 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.

@eparadis
Copy link
Author

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