Page 1 of 2

HOWTO: Enable the FN-F4 key (LCD/VGA switch)

Posted: 17 Mar 2009, 17:18
by voria
This howto explains how to enable the Fn-F4 hotkey.

IMPORTANT NOTE before starting: Ubuntu Karmic suffers a bug which prevent the VGA out to work correctly when compiz is enabled. So, make sure it's disabled when you want to use the VGA out (there is a convenient script in the 'samsung-scripts' package, binded to <ctrl><shift><alt>m by default, for switching compiz/metacity windows managers).

We will use the ARandR utility (a graphical interface to xrandr), which will allow us to create custom profiles (layouts) that can be used with the FN-F4 key.

Connect your external display to VGA port, then press Fn-F4.
If this is the first time you press it (in other words, if there are no previously saved screen layouts), ARandR will be launched.

It's easy to use:
in the main window there is a graphical representation of all the connected displays, they can be moved with the mouse to the preferred positions (if you want to use the desktop extension functionality).
In the 'Options' menu you can enable/disable both displays, and select a resolution and an orientation for each one.

What we need to do is to create profiles that will be then activated with the FN-F4 key.

Let's start by creating the first one (the standard one): external display disabled, internal display enabled with a resolution of 1024x600.
Make sure that settings are correct for each display (in the 'Outputs' menu, 'LVDS' must be enabled with a resolution of 1024x600, 'VGA' must be disabled), then click on 'Save as' and save the profile (I recommend to use an appropriate name to distinguish the profiles from each others).
Make sure to save all the profiles in <yourhome>/.screenlayout.

Now create all the profiles you need, giving them different names.
Obviously everyone has his needs (and different external displays...), so all I can do is to describe my configuration and the profiles I created.

My external display is a 19" LCD with a resolution of 1280x1024 and, because I have no interest in using the display extension functionality, I created only two profiles. The first one enables ONLY the external display to its native resolution, the second one clones screens with a resolution of 800x600.

Now that we have all the profiles we need, we can close ARandR.

From now on, the Fn-F4 key will switch to the next saved profile in a cyclic way.

If for any reason you need to start ARandR again (for instance, for creating another layout), launch it through the gnome menu (or kde menu, for kubuntu users).
If you want to delete a layout you don't need anymore, delete it from <yourhome>/.screenlayout/.
If no layouts are found in <yourhome>/.screenlayout, the Fn-F4 key will launch ARandR.

NOTE: when you press the FN-F4 key, the profiles that use external display are ignored when the external display is not connected. Also, to avoid to accidentally trigger the bug I mentioned above, the Fn-F4 key does nothing when compiz is enabled.

RE: [NC10] How to enable the FN-F4 key (LCD/VGA switch)

Posted: 18 Mar 2009, 21:58
by zinaf
voRia, sounds like a good solution to me. when i get a moment these days i will test and post feedback.
you are an amazing enthusiast. thanks a million for the the excellent work.

RE: [NC10] How to enable the FN-F4 key (LCD/VGA switch)

Posted: 19 Mar 2009, 19:24
by voria
I'm glad that my work is useful to others people besides me :)
I'll wait for your feedback! ;)

RE: [NC10] How to enable the FN-F4 key (LCD/VGA switch)

Posted: 23 Apr 2009, 16:37
by tkoorn
This is great. I spent hours last night trying to get something like this going but this worked for me in under 5 minutes. Excelent and thank you very much.

RE: [NC10] How to enable the FN-F4 key (LCD/VGA switch)

Posted: 12 May 2009, 08:07
by godsiem
Another great tip!

Already working on my laptop with my external monitor.

However, do you have any solution for unknown monitors, for example I often give presentations, and the projectors are weird and with different resolutions... this is in my opinion a big issue for people making presentation in linux... on my last presentation I got a terrible resolution and it was not very clear, but still was readable. I use "lxrandr" on my other laptop for these situations, it allows to clone the laptop and use only outside display or both... I think the trick I missed was a manual adjust of the resolution....

What I think we can do with the ARandR is to create right before the presentation a new profile, since the program "senses" the resolution of the external display... Have you have some tip for these situations, please let me/us know.

Cheers,

/godsiem

RE: [NC10] How to enable the FN-F4 key (LCD/VGA switch)

Posted: 12 May 2009, 14:35
by voria
'godsiem' pid='1108' dateline='1242112050' wrote: However, do you have any solution for unknown monitors, for example I often give presentations, and the projectors are weird and with different resolutions... this is in my opinion a big issue for people making presentation in linux... on my last presentation I got a terrible resolution and it was not very clear, but still was readable. I use "lxrandr" on my other laptop for these situations, it allows to clone the laptop and use only outside display or both... I think the trick I missed was a manual adjust of the resolution....

What I think we can do with the ARandR is to create right before the presentation a new profile, since the program "senses" the resolution of the external display... Have you have some tip for these situations, please let me/us know.
There is no need to create and save profiles for unknown monitors used sometime only.
You can simply connect the external monitor, start arandr, select the resolution you want to use for it from the 'Outputs' menu, then click 'Apply'. The changes will be lost when you will terminate your current session.

RE: [NC10] How to enable the FN-F4 key (LCD/VGA switch)

Posted: 12 May 2009, 14:37
by godsiem
I agree, it is indeed a solution perfectly feasible and reasonable!

Thank you!

RE: [NC10] How to enable the FN-F4 key (LCD/VGA switch)

Posted: 17 May 2009, 14:50
by godsiem
Hi,

I have just bought a very nice 22 inch monitor, where I connect my NC10! I configure the setup with arandr and it goes very nicely!

Unfortunately I am experiencing a strange behaviour... When I am working on the external monitor, with a lot of windows in different positions, and I want to go back to the NC10 only profile, a lot of the windows "get lost"... I think this happens due to their position in the external screen, which is out of the space that can be mapped to the NC10 screen... I made another test where I maximise all the windows, and in this setting the windows "do not get lost"...

Any ideia concerning this? Maybe this is something normal... but if so, it is a bit annoying...

Cheers,

/godsiem

RE: [NC10] How to enable the FN-F4 key (LCD/VGA switch)

Posted: 17 May 2009, 18:48
by voria
'godsiem' pid='1200' dateline='1242568255' wrote: I think this happens due to their position in the external screen, which is out of the space that can be mapped to the NC10 screen...
You are absolutely right, and unfortunately I think there is not real solution for this...

RE: [NC10] How to enable the FN-F4 key (LCD/VGA switch)

Posted: 02 Jun 2009, 14:41
by dicker182
Hi,

I have a litte problem. When I only use the external monitor, the desktop will be frozen after a minute. I can Stop this when I switch to the LVDS.

RE: [NC10] How to enable the FN-F4 key (LCD/VGA switch)

Posted: 06 Jul 2009, 18:12
by voria
Sorry for the late answer.
I don't know why this happens. Try downgrading 'xserver-xorg-video-intel' to version 2.6.3 from official ubuntu repositories (downgrade libdrm too, if needed).

RE: [NC10] How to enable the FN-F4 key (LCD/VGA switch)

Posted: 26 Aug 2009, 21:23
by voria
Now there is a solution: update to an intel driver with version >= 2.8.0 ;)

RE: [NC10] How to enable the FN-F4 key (LCD/VGA switch)

Posted: 03 Sep 2009, 01:04
by jdk_
Hi

I've installed arandr and it works great. But I haven't been able to set up things the way I want. I want to use both the screen of the nc10 and the external one, with the external one showing the top of the virtual desktop and the nc10 showing the bottom (so far so good), but with the nc10 being the main screen, by which I mean the one showing the gnome panels.

It seems that arandr assumes that the screen on top should be the main one. Is there a way to change this? maybe editting the configuration files directly if the gui doesn't give the right options?

RE: [NC10] How to enable the FN-F4 key (LCD/VGA switch)

Posted: 03 Sep 2009, 17:24
by dajs
First of all Thanks for alle the great scripts.

I am using Xubuntu. Anyone know which commands I need to enter in the XFCE keyboard bindings to switch between VGA and the netbook?

ARandR works fine, and I can switch too, but they keyboard binding does not work since its XFCE.

Nothing too important but if someone has an idea plz tell me.

Thanks.

RE: [NC10] How to enable the FN-F4 key (LCD/VGA switch)

Posted: 04 Sep 2009, 12:02
by voria
'jdk_' pid='1874' dateline='1251936261' wrote: It seems that arandr assumes that the screen on top should be the main one. Is there a way to change this? maybe editting the configuration files directly if the gui doesn't give the right options?
I don't know if there is a way to set permanently the main screen, but you can just drag and drop the gnome panels on the screen you want them on.