Last active
April 28, 2016 21:12
-
-
Save tylerneylon/133c9036053f8e7b820c9e686b3a5297 to your computer and use it in GitHub Desktop.
A simple bash function to help you stay focused.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
timey() { | |
# Inspired by | |
# https://gist.github.com/commanda/775ebcbe630919b554128b31c3dfb9dd | |
if [ "$#" -ne 1 ]; then | |
echo "usage: timey <number of minutes>" | |
return | |
fi | |
url=https://media.giphy.com/media/yWh7b6fWA5rJm/giphy.gif | |
seconds=$(( $1 * 60 )) | |
((sleep $seconds; open -a "Google Chrome.app" $url) &) | |
if [ $1 -eq 1 ]; then | |
echo Timey set for $1 minute. | |
else | |
echo Timey set for $1 minutes. | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Props to @commanda for this idea and making the original version.