Quick Timer Script

technology.pngThis is a really quick (but useful) countdown timer script for BASH. I call it (in a new terminal window) from tint2’s clock, which makes it nice and accessible. I put it together because all the other timers and alarm clocks were complicated; I just want something to bother me when the laundry’s done… and let me know how many minutes are left. An egg timer I can hear when I have headphones in…

#!/bin/bash

echo -e “E[0;36mPlease input the time you want to timer for in minutes.”; tput sgr0
read number
while [ $number -gt 0 ]; do
echo The number of minutes remaining is $number
sleep 60
let number=number-1
done

COUNTER=0
while [ $COUNTER -lt 10 ]; do
#this calls a libnotify alert
notify-send –icon=config-date “WAKE UP”
#I like the Torchwood theme as an alarm… but you can use whatever you like.
mpg123 -q /home/username/sounds/Torchwood.mp3
sleep 60
done

Popular posts:

  • If there's one Nazi (or a racist) at the table...
  • Word Porn Quotes
  • SOLVED: Command line BPM (beats per minute) Analysis in Linux
  • Everything Is Awful and I'm Not Okay, in multiple formats.
  • Courting a Polyamorous Person: Clearing Out Some Misconceptions
  • The difference between boundaries and rules
  • Bash string padding with SED