| ---------------------------------------- | |
| CLI Tricks: track | |
| May 31st, 2018 | |
| ---------------------------------------- | |
| This is a part of a series of phlog entries where I will share | |
| some of my command line tricks, tips, and scripts. | |
| ## track ## | |
| Fitness trackers are all the rage. Chances are that you've got one | |
| on you right now, weirdo. Collecting data about your own behavior | |
| is pretty neat. It's extra cool if you can do it in a way that | |
| doesn't also give that data away to nefarious strangers who want | |
| to take over the world, but I digress. | |
| I like tracking my shiz too. I've used my phone to count steps in | |
| the past, and I have a scale in my bathroom, and a tape-measure | |
| for my big belly. But where do I save those numbers so I can look | |
| back on my amazing progress of awesomeness later? I don't really | |
| want to hand that over to Google or MyFitnessPal. They don't need | |
| to know that stuff. I could just store it in text files for myself | |
| and parse them later. | |
| And that's exactly what I decided to do. I keep some csv files in | |
| dropbox, or in nextcloud, or in syncthing. But logging stuff in | |
| CSV files isn't really fun, so I wrote a little tracker app to | |
| help me out. | |
| Now you can enjoy the glory of my crappy little program too! | |
| First, grab a copy over on github [0] and install it. | |
| [0] track | |
| It's really easy to use. Start by checking the man page or | |
| spitting out some help: | |
| $ man track | |
| $ track -h | |
| See how to use it? Great! You're done! | |
| But seriously, it is really basic. You can just add a new metric | |
| to track by tracking something to it for the first time. It allows | |
| only one data point per day. It doesn't care what format that data | |
| is in. | |
| There's probably easy ways to break it, so, um, don't do those. | |
| Do you have something you want to add to it to make it better? | |
| Cool! Make a pull request and gimme-gimme. I probably want that | |
| feature too. | |
| Oh, as a side-note, the data I used in my post "Fat" [1] all was | |
| logged with this script. I have an example in that post of how to | |
| generate a graph on the command line using the jp utility. Check | |
| it out. | |
| [1] Fat | |
| Now that track is a bit more sophisticated, I can track my weight | |
| by typing: | |
| $ track -ac weight | jp -input csv -width 67 -height 25 | |
| A bit of an improvement! |