high wisdom



Sat Jul 5 12:20:17 IST 2008

Location aware GTD trick

I have my gtdo to manage the TODOs, and it shows me the list every time I open a terminal (via a 't ls' in my .bashrc). But what to do when my '@work' TODO list grows long and is shown to me on every terminal spawn, even at home?

what I also have is my network profiles setup. Till today, my office profile was called "office" - which I changed to "work". This makes my profile name the same as my context name ('work' and '@work' - we can manage the @ in the context). Do I need to say more? :)

Every time I do a 'NETSCHEME="work" sudo ifup ath0' and the network comes up, the '/var/run/network/ifstate' contains a line like 'ath0=ath0-home'. Which means, I can get the profile I'm using. Which means, if I name my profiles carefully, I can get the location I'm at. Which then means, if I name my contexts carefully, I can get the relevant context.

Adding this:
LOCATION=`grep -m 1 '-' /var/run/network/ifstate | awk -F '-' '{ print $2 }'`
t ls @$LOCATION
to my .bashrc works like magic.

By the way, I *could* scan for known SSIDs and select a network (and hence a location and a context) automagically, but I don't do that yet - one of the reasons being that I *think* there might be an information leak hidden somewhere. But I haven't thought it through. But I might, and then I might get around to doing it.

Posted by gera | Permanent link | File under: tricks, hacks | [ hide comments ]
Impressive! :)
Swati, 07.07.2008, 10:09h #
Now that you run Ubuntu, you can do it too!
Gera, 07.07.2008, 14:55h #
Will do!
Swati, 08.07.2008, 09:34h #
Why are you taking her down with you?

Swati, come back to Windows, it rocks :)
Raja, 16.07.2008, 12:26h #
No way! I like it better here :P
Swati, 16.07.2008, 17:30h #
Add comment here
name:
e-mail:
website:
spam-protection, please enter code: captcha, sorry
comment:

remember me
request e-mail if someone adds comments
Your e-Mail will not be published,
http://www.URL.com will turn to link automatically,
html is not permitted