A command line tool for earning and spending your leisure time.
npm install playtime



A command line tool for earning and spending your leisure time. Spend some time doing a more "virtuous"
task (e.g. study Chinese for 30 minutes or work on the book for 2 hours) and convert that into
minutes you can use later to do something a little less "productive" (like playing computer games or
binge watching that new series).
- Playtime
- Usage
- Commands
- playtime add
- playtime use
- playtime ls
- Configuration
- Config Directory
- Custom times / time modifiers
- Inspiration / Concept
- Development
- Releasing
``sh-session`
$ npm install -g playtime
$ playtime COMMAND
running command...
$ playtime (-v|--version|version)
playtime/0.0.1 darwin-x64 node-v14.7.0
$ playtime --help [COMMAND]
USAGE
$ playtime COMMAND
...
Add time spent on an activity in order to earn play time.
`sh`
$ playtime addYou'll be prompted to enter a time source and amount of time spent.
> 5 minutes added. 25 minutes of play time now available.
_See code: src/commands/add.ts_
Use play time that you've previously earned.
`sh`
$ playtime useYou'll be prompted to enter the time to use
> 5 minutes used. 20 minutes remaining.
_See code: src/commands/add.ts_
Show how much playtime you've previously earned.
`sh`
$ playtime ls
> 5 minutes of play time available
_See code: src/commands/add.ts_
The default config directory is ~/.playtime/. You can set a custom directory by adding the following
to your shell config:
`sh`
PLAYTIME_DIR=/whatever/path/you/like
By default the times available are 25 minutes, 50 minutes (both inspired by the Pomodoro Technique), and
90 minutes (inspired by Cal Newport's Deep Work). The
90 minutes time has a modifier of 1.5 applied, so an extra 50% of play time is awarded.
You can add custom times (with optional modifiers) by editing the file data.json in the configcustomTimes
directory (see the Config Directory section above for more info). You can add
a field to the json with an array of objects containing a minutes field and an optionalmodifier field. E.g.
`json`
{
"version":1,
"availableTime":17,
"timeSources":[{"name":"Study Spanish","modifier":0.2}],
"customTimes": [
{ "minutes": 30 },
{ "minutes": 60, "modifier": 1.2 }
]
}
Not surprisingly, this app was written on New Year's Eve as I reflected on some of my habits in 2020.
Two in particular stuck out. The first was that I was rarely spending my time doing "deep work". Some
of this was to blame on externalities - working from home full-time, adapting to having a first child,
my day job evolving into more of a management role, etc. - but the biggest difficulty I could identify
was that I rarely have a good trigger to start on deep work. When it comes down to the small, well-defined, surface
level task vs the large, ill-defined deep work, the former tends to be the default option.
The second issue, was much simpler - I'm really bad at moderating my leisure time! While it's not bad
enough to impact my relationships or work life, it does mean that when it comes to a choice between
working on a cool side project or playing that new video game, the latter tends to win. I didn't want
to quit playing games, and I didn't want to arbitrarily limit myself (I've tried this in the past and
it didn't stick), rather I wanted to find a way to bring some sort of balance to how I spend my time.
The objective then of playtime is to pit these two issues against each other in the hope of solving both.playtime
Do deep work, enter it into , and it gets transformed into time you can use later for
your leisure activities! It's still a somewhat arbitrary cap, but in the past I've found that systemising
habits in this way makes me more likely to stick to them. I can't speak to it's efficiency just yet,
but I'm hoping I can revisit this sentence in a few months and update it with a postive outcome!
Currently releasing is a manual process:
- Create a release branch from mainnpm publish
- Run main` (the only change should be the version number)
- Merge the branch back into