Skip to content

Instantly share code, notes, and snippets.

@andersonberg
Created October 5, 2017 00:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andersonberg/208ca50f902b8310244b8126b47f6876 to your computer and use it in GitHub Desktop.
Save andersonberg/208ca50f902b8310244b8126b47f6876 to your computer and use it in GitHub Desktop.
import datetime
import time
import subprocess
import progressbar
def pomodoro(interval, break_time=5):
subprocess.Popen(['notify-send', '-t', '0', 'Focus on your task!'])
for i in range(interval, 0, -1):
print i
time.sleep(60)
print 'End of pomodoro!'
subprocess.Popen(['notify-send', '-i', 'face-cool', 'End of pomodoro! Start break...'])
print 'Start break'
for i in range(break_time, 0, -1):
print i
time.sleep(60)
subprocess.Popen(['notify-send', 'End of break!'])
if __name__ == '__main__':
pomodoro(2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment