It’s NaNoWriMo! I’m not participating, because I know full well that I’m doing too many things this month, and trying to write fifty thousand words on top of all that is unrealistic.
But that doesn’t mean that you can’t. Because you can! You can do the thing! And if you, like me, would like to over-complicate an already difficult endeavor, maybe you want to have a way to update your wordcount from the command line. (I mean, if you’re trying to keep yourself from getting distracted while you’re trying to do your daily 1800-ish words, then opening a browser to update your word count is likely to lead you off-track. It does for me, anyway.)
So, for you, you wonderful dork, a Gist. May it serve you well.
In case you’re wondering how I use this script, I usually do my NaNoWriMo projects in plain text, writing in chunks every day, usually named something like “chunk_20171101.txt,” with all those chunks in a project folder. Since my main writing machine uses Xmonad as its window manager, I can just program a custom keyboard shortcut to invoke this script whenever I want.
So, with my blessing, take this terrible bit of bodged-together code, and if you find it useful, I don’t know, tweet at me or something.