Showing posts with label kde. Show all posts
Showing posts with label kde. Show all posts

Feb 17, 2012

Kubuntu 12.04: Waking up Lenovo X220 w/ or w/o multiple monitor connected

I use my Lenovo X220 laptop in two modes:

1. In the docking station with monitor connected
2. Without the docking station just with the display

I had problems with this setup when suspending / waking up in Kubuntu 12.04. When I suspend without docking station connected and wake up without docking station connected, everything goes well. But when I wake up in the docking station it has problems with recognizing the monitor. All I can do is to restart the Xserver. It means it is useless to suspend.

So I wrote the script to detect whether the laptop is in docking station or not while it is wakeing up.

Create new file:

$ sudo nano /etc/pm/sleep.d/90_switch_display

With this content:

#!/bin/bash

. /usr/lib/pm-utils/functions

case "$1" in
    hibernate|suspend)
        ;;
    thaw|resume)
        export DISPLAY=:0
        export XAUTHORITY=/home/<username>/.Xauthority
        xrandr --auto
        if xrandr | grep -q -e "HDMI2 connected"; then
          xrandr --output LVDS1 --off
          xrandr --output HDMI2 --auto --primary
        else
          xrandr --output HDMI2 --off
          xrandr --output LVDS1 --auto --primary
        fi
        ;;
    *)
        ;;
esac

exit

Than save it and set it executable:

$ sudo chmod 755  /etc/pm/sleep.d/90_switch_display

And that's it. Waking up behaves well ;-)

Feb 8, 2012

Kwin GLES as default window manager in Kubuntu 11.10 and KDE 4.8

Kwin GLES has great performance on my Lenovo Thinkpad X220. It looks more snappy and also the battery last longer.

After upgrading my laptop to KDE 4.8 I was unable to start Kwin GLES as default window manager. The only way was to switch it in console:

kwin_gles --replace &

It's not very comfortable. I found this hint on ArchWiki, and adapt it for Kubuntu:

First, you need kwin_gles installed:

sudo apt-get install kde-window-manager-gles

When it is installed, create new file ...

sudo nano /usr/share/kde4/apps/ksmserver/windowmanagers/kwin_gles.desktop

... with this content:

[Desktop Entry]
Name=KWin GLES
Exec=kwin_gles
TryExec=kwin_gles
X-KDE-WindowManagerConfigure=systemsettings
X-KDE-WindowManagerRestartArgument=--replace

Now you can change the window manager in the system settings: Open System Settings, go to Window Manager, select Use a different window manager: and select KWin GLES.


Next time you start your KDE session, you will be using Kwin GLES!