My Homemade "Unfuck Your Habitat" Linux or Unix app (program)

Unfuck Your Habitat is a cool website that exhorts its readers to clean their 'habitats.' It does this with daily prompts posted at regular times -- clean your bedroom, make your bed, prepare for the next day, etc.

There's also a companion app for iOS. It's a great concept. You fire it up, you tell it whether you want a chore that lasts 5, 10, or 15 minutes, and it gives you an appropriate prompt. Maybe it's a sad reflection on my constitution, but I find it a lot easier to let a program tell me to clean my countertop than to summon up the initiative myself. But the trouble is that none of the program's prompts was specifically written for me. In love with the concept but Without an easy way to edit the program's prompts, I decided I would craft my own Unfuck Your Habitat app.

I wanted my program to be tailored exactly for my needs. It had to give me prompts for cleaning my habitat -- no bullshit about basements or yards or garages. This was easy enough, as we'll see. 'It also had to be accessible to me at just about any time; having it tied to one specific computer or operating system wasn't going to work, and since there was no way I could get it on a phone, the best way to satisfy this requirement was to have it live on the server i am connected to via ssh 99.5% of the time i'm at a computer.

So what I came up with is quite simple. I have a plaine text file with one chore to each line. The sed program prints a line matching a random number in the range of 1 through the number of lines in my file. I have the sed command aliased so that all I ever need to do is type unfuck at the command prompt and I get my chore.

Here are specific steps to follow if the above description is a bit high level (it would have been for me).These instructions are specific to ksh, but bash and other shells should work with minor tweaking of the RANDOM variable seen in step 3.

  1. Create a file -- I called mine .unfuck -- that has all your chores, each one on its own line. Try to make these chores all about equal in the amount of time or effort they take, since unlike with the iOS app we're not going to have any way of choosing between easy and hard chores.
  2. Count the number of lines in the file (the command wc -l filename will do this).
  3. In the file where your store aliases (.profile for ksh), add a line like alias unfuck='sed -n `print $((RANDOM%27+1))`p .unfuck. Change 27 to the number of lines in your file. Also, if necessary, change .unfuck to whatever name your file has.
  4. Type unfuck at the command line to get your chore.

Go back to the homepage.


Last updated July 07, 2013.