Take the 2-minute tour ×

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
add comment

1 Answer

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
add comment

Your Answer


