Skip to content

Instantly share code, notes, and snippets.

@pattex
Created May 17, 2016 08:25
Show Gist options
  • Save pattex/37f00b50ff3f13f14cb2bfaead08c931 to your computer and use it in GitHub Desktop.
Save pattex/37f00b50ff3f13f14cb2bfaead08c931 to your computer and use it in GitHub Desktop.
#!/bin/sh
if [ -z "$1" ]; then
echo "Using arne's default offset for darjeeling in the daytime (3.5 minutes)."
echo "Otherwise specify your offset in seconds."
echo "\n\tteatime [seconds]\n"
offset=210
else
offset=$1
fi
target=$((`date +%s` + $offset))
while [ "$target" -ge `date +%s` ]; do
echo -n "$(date -u --date @$(($target - `date +%s`)) +%H:%M:%S)\r"
sleep 1
done
notify-send -u critical 'Teatime!' " {\n { }\n }_{ __{\n .-{ } }-.\n ( } { )\n |\`.. _____..-'|\n | ;--.\n | (__ \\n | | ) )\n | |/ /\n | / /\n | ( /\n \ y'\n \`-.._____..-'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment