An extension to this was pulling in my X session setup, since it is already in the same repository. This pretty much resulted in ~/init.sh 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:
- I have no network, and thus don't need stuff like instant messaging.
- I'm at work, and have more use for stuff like monitoring
- I'm at home, and have more use for stuff like gmail and a broader selection of instant messaging services.
- 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.