diff options
author | Patrick Simianer <p@simianer.de> | 2014-08-10 11:19:38 +0100 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2014-08-10 11:19:38 +0100 |
commit | 5869505d64c04c536bdcd71a197ade918c36bf1c (patch) | |
tree | 6af5232a9f2e058f15230a370a960f89871a2b74 /alarm |
init
Diffstat (limited to 'alarm')
-rwxr-xr-x | alarm | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -0,0 +1,24 @@ +#!/usr/bin/env ruby + + +u = ARGV[0][-1] +t = ARGV[0][0..-2].to_f + +if u == 'h' + t *= 60 + t *= 60 +elsif u == 'm' + t *= 60 +elsif u == 's' + true +else + exit +end + +t = t.round(0) + +puts "sleeping for to #{t} seconds" + +sleep t +`mplayer ~/var/alarm.mp3 &>/dev/null` + |