Tweeking KDE4

From Klaus' wiki
Revision as of 08:44, 12 August 2011 by Klaus (Talk | contribs)

Jump to: navigation, search

Using KDE (and probably also Gnome, which I do not use) on a laptop is sometimes a cumbersome experience. When connecting an external monitor to the laptop the default behaviour for KDE is to show the desktop on the two monitors with one left of the other or above or beneath moving the taskbar to the externally connected monitor. This is fine in some situations, but not always. I prefer to switch of the laptop monitor and only work on the external monitor. To automate this task I dropped this file in ~/.kde/env/monitorsetup. The file contains a setup of the monitor environment that I want.

#!/bin/bash
if [[ `xrandr -q|grep "VGA1 connected"` ]]
then
  xrandr --output VGA1 --auto;
  xrandr --output LVDS1 --auto;
  xrandr --output LVDS1 --off;
else
  xrandr --output LVDS1 --auto;
fi

The reason for placing the file in .kde/env is that KDE runs what ever it finds in this particular directory before loading KDE it self ensuring that the environment is in place when KDE starts.

(Source: [1] and [2])

Next problem is to find out how to handle a projector connected to the VGA socket.