#!/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 `mpv ~/var/alarm.mp3 &>/dev/null`