Justin starts a blog

Text

Todo.txt Rocks!

Loving Todo.txt. I wrote a quick perl script that monitors the mtime on my todo.txt file and redisplays whenever it updates. I have it running in a nice large font terminal right next to my email. Enjoy.

#!/usr/bin/perl

use strict;

my $path = "/Users/justin/Documents/todo/todo.txt";
my $last_mtime = 0;

while (1) {
	my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
    	   $atime,$mtime,$ctime,$blksize,$blocks) = stat($path);

	if ($mtime > $last_mtime) {
		$last_mtime = $mtime;
		print "\e[2J\e[0;0H";
		system("/Users/justin/bin/todo list");
	}

	sleep(1);
}

Posted on Tuesday, October 18 2011.
1
Notes
  1. whitneymcn reblogged this from justinday and added:
    haven’t run across...a (much cruder) homebrew shell script variation of this idea. Need to...
  2. justinday posted this
Justin starts a blog

nyc. hacker. blip.tv. vegan. drunkard.

Previous Next