Simple Hackable Pomodoro Timer
There are tons Pomodoro timers out there. But they are either not customizable, or have "Enterprise Architecture" with multiple methods and calls in the source code, making it complicated to quickly make changes. What if want to quickly customize timer for yourself?
You may want to:
- Score Habitica habits on completed or canceled Pomodoros
- Set Slack to "do not disturb" mode while Pomodoro is running
- Set Tomato Emoji as Slack status, so your colleagues get that you are "trying to concentrate"
- Update Beeminder to match goal of completing n Pomodoros per day
- Change color to match your favorite breed of tomato
- ...
So I've created one more Pomodoro timer . Less than 50 lines of *very simple cross-platform 1 Python script. By default, it displays "always on top" window with a timer in window and title.
The code has no options, as its self-explanatory and intended to be hacked and modified to fit your specific vision of how Pomodoro timers should work.
Recipes
Score tasks in Habitica
- Get USER ID and API TOKEN
-
Set
TASK_ID
= Task Alias -
In
stop
and following line:
requests.post('https://habitica.com/api/v3/tasks/'+TASK_ID+'/score/down', headers={'x-api-key': API_TOKEN, 'x-api-user': USER_ID})
-
In
complete
add following line:
requests.post('https://habitica.com/api/v3/tasks/'+TASK_ID+'/score/up', headers={'x-api-key': API_TOKEN, 'x-api-user': USER_ID})
Set Do Not Disturb in Slack
- Get xoxp_TOKEN
In
start
add following line:
requests.get('https://slack.com/api/dnd.setSnooze', params=(('token', xoxp_TOKEN), ('num_minutes', '25')))
-
In
complete
andcancel
add following line:
requests.get('https://slack.com/api/dnd.endSnooze', params=(('token', xoxp_TOKEN),))
Set Slack status to Tomato Emoji
-
In
start
add following line:
requests.post('https://slack.com/api/users.profile.set', params=(('token', xoxp_TOKEN), ('name','status_emoji'), ('value', ':tomato:')))
-
In
complete
andcancel
add following line:
requests.post('https://slack.com/api/users.profile.set', params=(('token', xoxp_TOKEN), ('name','status_emoji')))
Play sound on completion
- Install vlc.
-
In
complete
add following line:
os.system("cvlc /path/to/sound.wav vlc://quit")
# or
os.system("paplay /path/to/sound.wav vlc://quit")
Set Taskbar icon
- Credit goes to isaiah658 .
-
In
__init__
add:
self.root.tk.call('wm', 'iconphoto', self.root._w, tk.PhotoImage(data="R0lGODlhIAAgAOMIAAAAAHkAAJcDALUhBgBlANM/JAChAPFdQv///////////////////////////////yH+EUNyZWF0ZWQgd2l0aCBHSU1QACH5BAEKAAgALAAAAAAgACAAAASwEMlJq704622BB0ZofKDIUaQ4fuo5pSIcupK8eu1GkkM/EEDC7oMZeny/oBFQNCKDQmNz+FRKX5+D9lDoFlRIsG+55XrFPfSAvPV+RWH42Fh2q9VLN3LPHwj+AnlefYR+gIJdhX2AgUZ6inuMS5CGjH8BmAGTkJaAmZpOnJ0Cn5uKo6SZJCgfSKilRBc8Pq+qsR2ttKOwHlMArru2vTpLVy7FxifIQzQIyzvN0dLTEhEAOw=="))
-
And thats kids, how we oldtimers created cross-paltform apps before your fancy node and electron was invented. ↩