This Time Self-Hosted
dark mode light mode Search

An hacky trick to run KDE4 applications in a KDE3 session without messing stuff up

Warning: what I’m describing in this entry is an hacky, dirty trick which will not always work perfectly fine for you. Use it at your own risk.

Now that KDE4 is in portage, I wanted to try just a couple of applications, one being Umbrello, the other being Konqueror, even though I also tried GwenView (and that seems to me the most usable of the three 😉 ).

Unfortunately if you run a KDE4 application out of the box in a Gentoo system, it will mess stuff up with your config, and for instance KMail won’t be able to send mail anymore.

This is what I’ve done yesterday: first of all, I made sure that my default environment is the one for KDE 3.5:

cd /etc/env.d
ln -s 45kdepaths-3.5 40kdepaths-3.5

Afterward I prepared a copy of my .kde directory for the 4.0 slot:

rsync ~/.kde3.5 ~/.kde4.0/Code language: JavaScript (javascript)

(make sure you write the / after .kde4.0 or it’ll create ~/.kde4.0/.kde3.5)

Then I wrote this simple script:

#!/bin/bash

export KDEHOME=~/.kde4.0
export PATH=/usr/kde/4.0/bin:${PATH}
export XDG_DATA_DIRS=/usr/kde/4.0/share:${XDG_DATA_DIRS}
export KDEDIRS=/usr/kde/4.0:${KDEDIRS}

exec=$1
shift

/usr/kde/4.0/bin/$exec "$@"Code language: PHP (php)

At this point, running kde4 konqueror will bring me the konqueror from KDE4 rather than the one from 3.5, using is own settings, and without messing stuff up in my 3.5 installation (which I still daily use).

Just my two €.05 😉

Warning: this dirty, hacky trick is not supported by Gentoo developers, and most likely a good part of the Gentoo KDE team would like to kill me for just posting this 😛

Comments 6
  1. Sure, just please link back to this entry, so that if there are mistakes I can fix them.

  2. Thank you Diego, I’m italian as you, i have tried to add you on Jabber but i haven’t response, can you add me please?Naturally i link this post (i hope before i can complete my upgrade to KDE 4.0.0 on my gentoo and next repost this).Bye

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.