dotfiles

config files and scripts at HOME.
git clone git://git.ricketyspace.net/dotfiles.git
Log | Files | Refs

commit b323c376e2bf127bea6364fec6ba9e09d002c7d7
parent 815dabb8d9f86ea893fe0b6c5dc14c86d4c10e11
Author: rsiddharth <s@ricketyspace.net>
Date:   Sat, 30 Dec 2017 15:34:59 +0000

Add .bin/alarm

Diffstat:
.bin/alarm | 23+++++++++++++++++++++++
1 file changed, 23 insertions(+), 0 deletions(-)

diff --git a/.bin/alarm b/.bin/alarm @@ -0,0 +1,23 @@ +#!/bin/sh +# +# Copyright © 2017 rsiddharth <s@ricketyspace.net> +# +# Licensed under GNU General Public License version 3 or later. +# +# Usage +# +# $ alarm HH:MM +# + +# Time in seconds since epoch. +TIME=$(date -d$1 +%s 2> /dev/null); + +if [ -z $TIME ];then + echo 'Invalid time' + exit 1 +fi + +# Calculate delay [ time - current_time ] +FOR=$(($TIME - $(date +%s))) + +sleep $FOR; mpc play