Gymstreak is a utility to print an indicator of your recent gym attendance in your bash prompt.
This only works with your Planet Fitness checkins. I am not affiliated with Planet Fitness and they may block this at any time.
By default visits are shown with yellow, days off are shown in purple:
These characters and colors can be customized. See output format.
npm i -g gymstreak
There are two steps to set this up once installed.
1. Install in your crontab
crontab -e and add the following line. This will query the gym every hour for checkins.
0 * * * * gymstreak fetch --username "xxxx" --password 'xxxx' --days "14"
2. Configure your prompt in
This will output your current streak in your prompt. If you've never done this before, I recommend you read this first: https://www.howtogeek.com/307701/how-to-customize-and-colorize-your-bash-prompt/
gymstreak format 2>/dev/null}PS1+='$(gym_streak) '
--went <spec> and
--away <spec> options to control how the days you attend and/or don't attend the gym are formatted.
The format of
character is the character to display and
color is an optional ANSI 256 color code.
gymstreak format --went x:201 --away o
Will display days attended in a pink
x and days away in an
o using the default away color.
Certain characters may appear squished together. In this case you can add a space to the end when specifying them:
gymstreak format --went '💪 ' --away '💤 '
Starting with v1.1, gymstreak reads and writes a file instead of relying on the file being piped through stdin/stdout. The default file is
~/.gymstreak but can be overridden by the