HOWTO: Enable the FN-F4 key (LCD/VGA switch)
Posted: 17 Mar 2009, 17:18
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.
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.