--- startkde.orig 2008-08-19 21:56:42.000000000 +0200 +++ startkde 2008-09-15 14:39:53.000000000 +0200 @@ -7,6 +7,15 @@ # because we still need to do some cleanup. trap 'echo GOT SIGHUP' HUP +# Gentoo: setup environment, filter other slotted KDE installs from PATH +_KDEDIR=@REPLACE_PREFIX@ +export KDEDIRS=${_KDEDIR}:/usr:/usr/local +export PATH=${_KDEDIR}/bin:$(echo ${PATH} | sed 's#/usr/kde/[^/]*/s\?bin[:]\{0,1\}##g') +export ROOTPATH=${_KDEDIR}/sbin:${_KDEDIR}/bin:$(echo ${PATH} | sed 's#/usr/kde/[^/]*/s\?bin[:]\{0,1\}##g') +export LDPATH=@REPLACE_LIBS@:${LDPATH} +export XDG_DATA_DIRS=${_KDEDIR}/share:$(echo ${XDG_DATA_DIRS} | sed 's#/usr/kde/[^/]*/s\?share[:]\{0,1\}##g') +# Gentoo part ends + # Check if a KDE session already is running if kcheckrunning >/dev/null 2>&1; then echo "KDE seems to be already running on this display." @@ -14,6 +23,20 @@ exit 1 fi +# Gentoo part: +# Scraped old KDE 3.x -> 3.y update code, but keep symlink code +cd ${HOME} +if [ -L .kde -o ! -d .kde ]; then + # handle ~/.kde* dirs - separate ones for separate KDEs + rm -f .kde + if [ ! -e .kde3.5 ]; then + mkdir .kde3.5 + cd ${HOME} + fi + ln -sf .kde3.5 .kde +fi +# Gentoo part ends + # Set the background to plain grey. # The standard X background is nasty, causing moire effects and exploding # people's heads. We use colours from the standard KDE palette for those with @@ -180,6 +203,13 @@ done done +# Source scripts in /etc/X11/xinit/xinitrc.d/ for system-level defined stuff +if test -d "/etc/X11/xinit/xinitrc.d/"; then + for file in "/etc/X11/xinit/xinitrc.d/"*; do + test -x "$file" && . "$file" + done +fi + # Activate the kde font directories. # # There are 4 directories that may be used for supplying fonts for KDE. @@ -386,7 +416,7 @@ # Clean up kdeinit_shutdown dcopserver_shutdown --wait -artsshell -q terminate +if test -e ${_KDEDIR}/bin/artsshell ; then artsshell -q terminate ; fi # KDE4 support kde4 kdeinit4_shutdown 2>/dev/null