Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
Ilinsekt
Post subject: How-To: choose between Compiz and KWin at login  PostPosted: 14.02.2011, 05:55



Joined: 2010-10-29
Posts: 43

Since it took me three hours to get this working, I thought I might write it down for other people.

The goal is to be able to choose whether you want a Compiz or a KWin session in the KDM session menu.

First, let's create a script in /usr/bin/ksmserver_windowmanager , which has the following in it:
      Code:

#!/bin/sh
cd $HOME/.kde/share/config/
case "$1" in
  compiz)
  /bin/sed -i -r 's/(windowManager=).*?/\1compiz/' ksmserverrc
  ;;

  kwin)
  /bin/sed -i -r 's/(windowManager=).*?/\1kwin/' ksmserverrc
  ;;
esac
exec /usr/bin/startkde

Make it executable for all users. Your .kde/share/config/ksmserverrc must have a windowManager=... line for this to work. This will be the case if you played around with the default window manager in systemsettings, otherwise just add it in the [General] section.

Now we'll create the actual KDM entries. Create a file /usr/share/xsessions/kde-compiz.desktop and put the following in it:
      Code:

[Desktop Entry]
Encoding=UTF-8
Type=XSession
Exec=/usr/bin/ksmserver_windowmanager compiz
TryExec=/usr/bin/startkde
Name=KDE with Compiz
Name[de]=KDE mit Compiz
Comment=KDE with Compiz
Comment[de]=KDE mit Compiz

Feel free to add names and comments in your language. Create another file, /usr/share/xsessions/kde-kwin.desktop, with this:
      Code:

[Desktop Entry]
Encoding=UTF-8
Type=XSession
Exec=/usr/bin/ksmserver_windowmanager kwin
TryExec=/usr/bin/startkde
Name=KDE with KWin
Name[de]=KDE mit KWin
Comment=KDE with KWin
Comment[de]=KDE mit KWin


Now to the part that puzzled me the most. We'll be fixing a bug in x11-common, which prevents the passing of arguments to X sessions ( http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=566825 ). Open the file /etc/X11/Xsession.d/20x11-common_process-args with your favorite text editor and replace line 48 (the one starting with STARTUP_FULL_PATH in case you have a different version) with
      Code:
STARTUP_FULL_PATH=$(/usr/bin/which "${1%% *}" || true)

We're done. You shoud now see two additional entries in KDM's session selection menu. If you're feeling very confident today, you can rename /usr/share/xsessions/kde.desktop to e.g. kde.desktop.bak to get rid of the now unecessary entry.
 
 View user's profile Send private message  
Reply with quote Back to top
diblOffline
Post subject: RE: How-To: choose between Compiz and KWin at login  PostPosted: 14.02.2011, 17:36



Joined: 2010-09-12
Posts: 302
Location: Dayton, Ohio, USA
Status: Offline
Since kwin desktop effects has had the mousewheel rotate feature, I no longer use compiz. But ... thank you llinsekt for doing this.
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 12 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by Zafenio