One of the things that I’ve been working on over the weekend, is expanding my unix profile a bit. Pretty much, I have a universal ~/.sh directory that houses a profile for Bourne style shells, well, modern ones in the sense that functions are supported, which is like everything since 1980 or so.

An extension to this was pulling in my X session setup, since it is already in the same repository. This pretty much resulted in ~/ becoming ~/.sh/rc.xinit. I pretty much use the same setup across machines, so it’s not a big problem; but startup programs based on where I am and what I’m doing, rather than normal session management.

So this poses a good question, short of resulting to some kind of “Session Chooser” on login, how to make it smart? Magic kind of smart! It’s not hard, so much as it is a bit sticky. The thing that varies the most is the network. Either:

  1. I have no network, and thus don’t need stuff like instant messaging.
  2. I’m at work, and have more use for stuff like monitoring
  3. I’m at home, and have more use for stuff like gmail and a broader selection of instant messaging services.
  4. I’m using my phone, and need to worry more about data usage than pre-loading applications.
So obviously, the idea is to react based on what network is in use. That is pretty easy by asking nmcli for the name of the network connection being used, once NetworkManager gets the ball running. Case statements ftw :-).
I have found one problem so far, which is that the instant messaging client that I use, has a command line interface to specify which accounts to sign in, but apparently, pidgins -l option doesn’t work as advertised by –help—or NAME != the name in accounts.xml. So perhaps I’ll just have to use separate clients for at work and not at work, or modify the XML file.