eeePC dual screens part 2

Recap

Continuing from eeePC dual screen part 1, here are the three problems again:

  1. Compiz cube spanned both screens, resulting in one big cube.
  2. The gnome-panels in dual screens mode are located in the external screen. I would like them to stay in the internal screen instead.
  3. I am using “Fill screen” setting for my desktop wallpaper. Upon activating the dual screens mode, the wallpaper stretched into both screens, rather than being duplicated to fill each screen separately.

Separate Compiz cube

This one is easy. “Launch CompizConfig Settings Manager” (found under: Panel Menu > System > Preferences > Advanced Desktop Effects Settings). Under “Desktop” category, open “Desktop Cube”. The last item of “General” (first) tab is “Multi Output Mode”. Change the setting to “Multiple cubes”.

Moving gnome-panel

As mentioned, the gnome-panels got moved to the external screen when you enable dual screens. One way to move the gnome-panels back to the internal screen is to simply drag them there. However, when you revert to single screen and then back to dual screens again, you have to repeat this. I’m sure this would get frustrating after a while. Not to mention you could also messed up the panel icons positioning, if you accidentally moved a panel to the wrong screen edge.

The fact that you could drag the panels back to the internal screen tells me that there must be a setting somewhere to indicate the panel location. The most obvious place to look is in gconf. After mucking around using “gconf-editor”, I found the key

/apps/panel/toplevels/top_panel_screen0/monitor

for the top panel, and

/apps/panel/toplevels/bottom_panel_screen0/monitor

for the bottom panel.

This is how it works. If the key value is 0, then the panel is placed in the primary screen. In dual screens mode, the external screen got assigned as the primary screen, which is why the panels ended up in the external screen. The internal screen became the secondary screen. To move the panels to the internal screen, you need to change the key value to 1.

This can be accomplished from the command line by “gconftool2″. After enabling dual screens, run this command to move the gnome-panels to the internal screen.

gconftool-2 -s -t int /apps/panel/toplevels/top_panel_screen0/monitor 1
gconftool-2 -s -t int /apps/panel/toplevels/bottom_panel_screen0/monitor 1

Then, before disabling dual screens, run this command to revert the gnome-panels to the original locations.

gconftool-2 -s -t int /apps/panel/toplevels/top_panel_screen0/monitor 0
gconftool-2 -s -t int /apps/panel/toplevels/bottom_panel_screen0/monitor 0

Fixing the wallpaper

There are a few ways to fix the wallpaper, depending on how much time you want to spend on it, and what result you want to achieve.

  1. The simplest fix is no fix. You use any wallpaper you like in single screen, and ignore the stretching in dual screens.
  2. Create a 2048×768 wallpaper which has two parts. Have a 1024×600 picture on the left-hand side, and a 1024×768 picture on the right-hand side. Use “Tiled” setting.
  3. You use a 1024×768 wallpaper in “Tiled” setting. You would get a slightly cropped wallpaper in your internal screen and a correct wallpaper in the external screen.
  4. Same as above, except to use “Fill screen” in single screen (so it get squished instead of cropped), and “Tiled” in dual screens.

I used the last method since it’s sort of a middle ground compromise. However, instead of manually changing between “Fill screen” and “Tiled”, I use “gconftool2″ again.

This command will set the “Tiled” setting when in dual screens mode (note the key is set to “wallpaper” for “Tiled”).

gconftool-2 -s -t string /desktop/gnome/background/picture_options wallpaper

This command will set the “Fill screen” setting when in single screen mode (note the key is set to “stretched” for “Fill screen”).

gconftool-2 -s -t string /desktop/gnome/background/picture_options stretched

Bringing everything together

So, the entire hack is almost complete. Now, we bring everything together in the form of two bash scripts.

The first script (I called it “screen-dual.sh”) change the mode from single to dual screens.

#/bin/bash

xrandr --output LVDS --auto --output VGA --auto --pos 1024x1
gconftool-2 -s -t string /desktop/gnome/background/picture_options wallpaper
gconftool-2 -s -t int /apps/panel/toplevels/top_panel_screen0/monitor 1
gconftool-2 -s -t int /apps/panel/toplevels/bottom_panel_screen0/monitor 1

And vice versa, the second script (I called it “screen-single.sh”) change the mode from dual to single screen.

#/bin/bash

gconftool-2 -s -t int /apps/panel/toplevels/top_panel_screen0/monitor 0
gconftool-2 -s -t int /apps/panel/toplevels/bottom_panel_screen0/monitor 0
gconftool-2 -s -t string /desktop/gnome/background/picture_options stretched
xrandr --output LVDS --auto --output VGA --off

Make the files executable using these commands.

chmod +x screen-single.sh
chmod +x screen-dual.sh

One final note. You would notice in “screen-dual.sh”, I use “--pos 1024×1″ instead of “--right-of” option. I have my top gnome-panel hidden to 1 pixel height. Possibly due to improper implementation, the external screen showed a slight display artifact in the area where the top gnome-panel should have been. By shifting the external screen slightly lower, I removed the artifact.

Post a Comment

Your email is never published nor shared. Required fields are marked *