alarm

Programming issues and discussion
Scooby
Site Admin
Posts: 826
Joined: 09 Sep 2013, 16:52

alarm

Postby Scooby » 23 Oct 2013, 20:45

Had to time the potatoes cooking while working in front of computer and came up with this unsophisticated alarm function.


Code: Select all

#alarm <description> <minutes>
#example: alarm "Check potatoes" 20
function alarm() {
  echo  "alarm set for: $1 in $2 minutes"

  #Use some trickery to suppress output written by jobs control and return shell to interactivity
  (  { sleep $2m; notify-send -t 0  -i gtk-dialog-info alarm  "$1"; mpg123 -q /usr/share/audio/login.mp3;  } & ) > /dev/null 2>&1
}

Return to “Scripting and Programming”

Who is online

Users browsing this forum: No registered users and 12 guests

cron