Monday, February 13, 2012

KDE4: Change Window Manager

There are two ways to change the default Kde4 window manager. One involves creating a script that changes a global variable and the other involves using Kde system settings. While both methods work I always find solutions involving working in a terminal to be simpler and faster. Still I will be detailing both methods to the best of my knowledge.  

Update: Recently it has become quite popular to try out the new opengl es mode of kwin. Which was originally aimed to bring proper compositing to mobile platforms and is paving the way for compositing on wayland. Currently it seems that this new code will eventually replace the old opengl code. The reasons to why this is so interesting is that it supposedly brings a few perfomance improvements. I've yet to confirm this, but it does run fine on my netbook using intel drivers. But on my desktops using Nvidia graphics it fails miserably, this could be beceause of the code or because of the Nvidia drivers, who knows. Anyway it is worth trying out, but keep in mind that your mileage may very greatly depending on what kind of hardware and drivers you are using.

Have a look at Martin Gräßlin's blog for further details.
http://blog.martin-graesslin.com/blog/2011/07/running-kwin-with-opengl-es-2-0/

 

Using System Settings:

Navigate into System Settings >> Default Applications >> Window Manager. Here you should be able to switch to whichever alternative window manager you may have installed.

In the few cases where your window manager do not show up in the list here. You can either resort to using a script file or simply create a new entry containing your window manager of choice. To add a new entry in the window manager list you will have to navigate to “/usr/share/apps/ksmserver/windowmanagers”. Create a new file called “YourWindowManager.desktop”.
 
YourWindowManager.desktop
----------------------------------------------------------------------
[Desktop Entry]
 Name=Openbox # The visible name
 Exec=openbox
 TryExec=openbox
 X-KDE-WindowManagerConfigure=obconf # Configure button launches this.
 X-KDE-WindowManagerRestartArgument=--replace

After you have created that file you should be able to find it in the list within systemsettings. Below is how the file would look if you would want to add kwin_gles to your selection. Kwin_gles should be included by default if you are running Kde 4.8 or later.
 
kwin_gles.desktop
----------------------------------------------------------------------
[Desktop Entry]
 Name=KWin GLES
 Exec=kwin_gles
 TryExec=kwin_gles
 X-KDE-WindowManagerConfigure=systemsettings
 X-KDE-WindowManagerRestartArgument=--replace

 

Using A Script:

Navigate into your “Kde4 homedir/env”. In Arch Linux this would be “~/.kde4/env” and in Kubuntu/Linux Mint it would be “~/.kde/env”. Every script located inside the “env” directory will always be parsed/read before Kde loads the window manager. This directory is used to setup the environment in which Kde will launch all of its services. Hence the shorthand “env”. Now create “YourScript.sh”.
 
YourScript.sh
----------------------------------------------------------------------
#!/bin/sh
export KDEWM=openbox

You can replace openbox with whatever window manager of choice. And if you want to fallback to using kwin you can simply either delete the script or replace openbox with kwin, “kwin” being the default Kde window manager.

No comments:

Post a Comment