Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm looking for a way to have a couple (or three) multiple configurations set up on my laptop, and easily switch between them. To be more specific, when my laptop is at work, it's plugged into a second monitor, and has a specific set of networks configurations. At home, the second monitor is gone, the network configurations are different. At a public wireless point there are other configurations to set, etc.

I know I can go into my preferences and turn on/turn off the monitor, and mess with the networking preferences, and so on, but I'm looking for a way to change a bunch of preferences all at once, and if it's possible to do that automatically, maybe based on the wireless APs in the vicinity, that would be even better.

share|improve this question
up vote 1 down vote accepted

There are probably many ways to do this depending on your specifics, but here's one way. Put your configuration into ~/.xsessionrc. From there you can start xrandr to set up your screens and iwconfig for your network, or whatever. You could run iwlist or something similar to search for access points, but note that that will slow down your login process. So here is a rough example:

if sudo iwlist scan | grep -q 'ESSID:"xxx"'; then
   xrandr ...
   iwconfig ...
else ...
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .