Ubuntu – How to make a gnome panel only appear if I have a second monitor hooked up

gnome-panelmultiple-monitorsUbuntu

I have a laptop with Ubuntu installed on it and I'm constantly switching from just my laptop to also having a monitor. When I'm using the laptop screen and monitor, I have a panel on each monitor that shows the windows open for that monitor. If I switch to just using the laptop screen, then both panels end up on the same screen. How can I configure one of the panels to only show up if I have two monitors? Or can I at least "suspend" one of the panels somehow so I don't have to set it up the way I like it every time I switch?

• Try setting the screen option for this panel via gconf-editor.

Run gconf-editor and navigate to the panel options at /apps/panel/toplevels/panel_1/ (your panel name may vary slightly). You should see an option screen as shown below. Try configuring this to your liking.

I'm not sure this will work, as I have a feeling that when you switch to using just the laptop screen, this value is automatically changed to the available screen. It's worth a shot.

If you use Xinerama, there's also an option to configure the monitor the panel appears on.

If none of these work, I'd suggest you enable auto-hide, and set a very low auto_hide_size so the panel is barely visible when you switch to one screen.

I haven't researched this yet, but if there is a command-line way to modify these values, I'd just use a script to tweak these values so the panel is hidden when I want it.