Another copy of my dotfiles. Because I don't completely trust GitHub.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

30 lines
510 B

#!/bin/sh
icon=
now=$(date '+%s')
if [ ! -f "$XDG_RUNTIME_DIR/timer" ]; then
end=0
else
content=$(cat "$XDG_RUNTIME_DIR/timer")
if [ -z "$content" ]; then
end=0
else
end="$content"
fi
fi
if [ $end != 0 ]; then
if [ $now -ge $end ]; then
canberra-gtk-play -i alarm-clock-elapsed -V 10
echo "" > "$XDG_RUNTIME_DIR/timer"
else
diff=$(expr $end - $now)
str=$(date -ud @$diff '+%H:%M:%S' | sed 's/^00://g')
echo "^c#a48ead^$icon ^d^ $str"
fi
else
echo "^c#a48ead^$icon ^d^ NONE"
fi