Linux timer app command line goodness!

I googled for “linux timer app” looking for something like a virtual kitchen timer I use to remind me to switch back to standing after a sit-break at my workstation.  And Google found this gem for me from Pat Brisban on the ArchLinux forums:

  # set an ad-hoc GUI timer
  timer() {
    local N=$1; shift
    (sleep $N && zenity --info --title="Time's Up" --text="${*:-BING}") &
    echo "timer set for $N"
  }

It’s a bash function you stick in your .bashrc or .bash_aliases file and then call from the command line like this:

  $ timer 30s
  $ timer 35m get the laundry

As Pat said: “works great.”

via Good Timer App? (Page 1) / Applications & Desktop Environments / Arch Linux Forums.

Leave a Reply

You must be logged in to post a comment.