# simple pomodoro script

**URL:** <https://forum.beeminder.com/t/simple-pomodoro-script/6592>\
**Category:** Tech\
**Created:** [April 18, 2020, 10:21pm UTC](https://forum.beeminder.com/t/simple-pomodoro-script/6592 "2020-04-18T22:21:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mtrazzi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.beeminder.com/mtrazzi/32/3383_2.png) [@mtrazzi](https://forum.beeminder.com/u/mtrazzi)\
**Post date:** [April 18, 2020, 10:21pm UTC](https://forum.beeminder.com/t/simple-pomodoro-script/6592/1 "2020-04-18T22:21:51Z")

</div>

hi there, i was using strict workflow beeminder for a while, but figured out eventually that using a chrome extension was too distracting when i was just coding, so i wrote a little bash script to run pomodoros offline. i just updated it so that it automatically increments a beeminder “pomodoro” goal after each pomodoro. let me know what you think!

> [https://github.com/mtrazzi/pom](https://github.com/mtrazzi/pom)

---

<div class="post-metadata">

**Author:** ![alys](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.beeminder.com/alys/32/4726_2.png) [@alys](https://forum.beeminder.com/u/alys)\
**Post date:** [April 19, 2020, 11:48am UTC](https://forum.beeminder.com/t/simple-pomodoro-script/6592/2 "2020-04-19T11:48:30Z")

</div>

Oh cool! I love bash one-liners. 🙂 That’s pretty nifty.

I’ve started using [notify-send.sh](https://github.com/vlevit/notify-send.sh) recently for persistent and/or programmatically-cancellable Ubuntu notifications, so I’ll probably drop that in to the loop before and after breaks.

Thanks for sharing!

---

<div class="post-metadata">

**Author:** ![phi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.beeminder.com/phi/32/2586_2.png) [@phi](https://forum.beeminder.com/u/phi)\
**Post date:** [April 19, 2020, 2:05pm UTC](https://forum.beeminder.com/t/simple-pomodoro-script/6592/3 "2020-04-19T14:05:50Z")

</div>

Nice! I like some command line beeminder goodness! May I suggest putting the config file not directly in the user’s home? The [XDG Base Directory Specification](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html) has recommendations as to where to put things like this.

Examples can be found in this SO answer:

> <https://stackoverflow.com/questions/1024114/location-of-ini-config-files-in-linux-unix/1024339#1024339>

Also for macOS I think it is a good idea to store the `auth_token` in keychain:

> [@Common place to store the Beeminder auth\_token locally](https://forum.beeminder.com/t/common-place-to-store-the-beeminder-auth-token-locally/6019):
>
> I propose the following keychain entry for macOS: security add-generic-password \ -l 'auth\_token' \ -a 'your beeminder username' \ -s 'www.beeminder.com' \ -j 'auth\_token for use of the Beeminder API' \ # https://www.beeminder.com/api/v1/auth\_token.json -w 'here\_goes\_your\_auth\_token' \ -U to be retrieved again with: security find-generic-password \ -l 'auth\_token' \ -a 'your beeminder username' \ -s 'www.beeminder.com' \ -w which will write it to stdout.

---

<div class="post-metadata">

**Author:** ![mtrazzi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.beeminder.com/mtrazzi/32/3383_2.png) [@mtrazzi](https://forum.beeminder.com/u/mtrazzi)\
**Post date:** [April 19, 2020, 9:20pm UTC](https://forum.beeminder.com/t/simple-pomodoro-script/6592/4 "2020-04-19T21:20:10Z")

</div>

thanks @alys, seems like there are some cool notifications in your linked repo! my main goal was to have some kind of “bell” replacement, but i agree that other events might prove useful.

@phi changed the config file to `~/.config/beeminder/.pomrc` according to your linked specifications. for the auth\_token i don’t have any mac to test it on at the moment and would prefer to keep it os agnostic, but i’ll keep that in mind if i decide to make it work well on mac, thanks.

---

<div class="post-metadata">

**Author:** ![zzq](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.beeminder.com/zzq/32/6471_2.png) [@zzq](https://forum.beeminder.com/u/zzq)\
**Post date:** [April 21, 2020, 10:56am UTC](https://forum.beeminder.com/t/simple-pomodoro-script/6592/5 "2020-04-21T10:56:46Z")

</div>

One of the coolest things about the XDG Base Directory Specification is that it gives control to the user to specify where all the various dotfiles and so forth go via environment variables (with sane defaults).

So I’d like to suggest something like this:

```python
config_folder = os.environ.get('XDG_CONFIG_HOME', os.path.expanduser('~/.config'))
config_path = os.path.join(config_folder, 'beeminder/.pomrc')

```

This lets users override the location of their config folder by exporting the `XDG_CONFIG_HOME` environment variable. (It also slightly improves things by taking full advantage of [`os.path.expanduser`](https://docs.python.org/3/library/os.path.html#os.path.expanduser)'s ability to expand the tilde at the beginning of a longer path, and not just when the tilde is on its own.)
