Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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 ...
fi
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.