summaryrefslogtreecommitdiff
path: root/alarm
blob: 6264b0d95c1f1d636ed59831b9dca6d79a166653 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/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`