How to set the KDE path?

Boyd Stephen Smith Jr. bss at
Wed Feb 2 20:16:08 GMT 2011

In <AANLkTinAu6odRJHDBNvxQyFgfBPn5gxsZFbHFhavDDvo at>, Dotan 
Cohen wrote:
>On Wed, Feb 2, 2011 at 11:00, Boyd Stephen Smith Jr.
><bss at> wrote:
>> In <AANLkTikOpLE7TohYotw8g9zn7dCKVBn0WBOLGWrCdLhf at>, Dotan
>> Cohen wrote:
>>>It is rather frustrating that the Plasma Krunner (Alt-F2) does not
>>>follow the path configured in $HOME/.profile.
>> Are you using bash and have a .bash_profile?  I think .bash_profile is
>> preferred by bash (and things trying to emulate bash's behavior) when
>> both .profile and .bash_profile exist.
>I am specifically referring to the Krunner (Alt-F2) dialogue.

Still.  My question is surprisingly valid.  I've found an annoying little 
script in /etc/kde4/kdm/Xsession that tries to emulate the behavior of your 
shell configured in /etc/passwd.  So, the shell you set with chsh can, 
absurdly, affect how your KDE SC environment behaves.

>>>So, what is the correct syntax for configuring the KDE path in
>>>~/.xinitrc? Thanks!
>> Don't use that.
>> If you need to set up global environment variables for your KDE
>> sessions, use ~/.kde/env/$
>Do you know the syntax? It is not the bash syntax. Thanks.

Works for me here:
$ cd ~/.kde/env
$ ls
$ cat *
#! /bin/sh

# Make sure our customised gtkrc file is loaded.
if [ -r "$HOME"/.gtkrc-2.0-kde ]; then
        GTK2_RC_FILES=$HOME/.gtkrc-2.0-kde; export GTK2_RC_FILES
elif [ -r "$HOME"/.gtk_qt_engine_rc ]; then
        GTK2_RC_FILES=$HOME/.gtk_qt_engine_rc; export GTK2_RC_FILES
#! /bin/sh
# Starts keychain or initializes the environment, but requires no 
if [ -x /usr/bin/keychain ]; then
        eval "$(/usr/bin/keychain --eval --quiet --inherit any-once --stop 
others --noask --lockwait 0)"
#! /bin/sh

if [ -x /usr/bin/ksshaskpass ]; then
        SSH_ASKPASS=/usr/bin/ksshaskpass; export SSH_ASKPASS
elif [ -x /usr/bin/x11-ssh-askpass ]; then
        SSH_ASKPASS=/usr/bin/x11-ssh-askpass; export SSH_ASKPASS
elif [ -x /usr/lib64/ssh/x11-ssh-askpass ]; then
        SSH_ASKPASS=/usr/lib64/ssh/x11-ssh-askpass; export SSH_ASKPASS
elif [ -x /usr/bin/ssh-askpass ]; then
        SSH_ASKPASS=/usr/bin/ssh-askpass; export SSH_ASKPASS
elif [ -x /usr/lib64/ssh/ssh-askpass ]; then
        SSH_ASKPASS=/usr/lib64/ssh/ssh-askpass; export SSH_ASKPASS

>> I use kdm-4 and it has this annoying habit of sourcing both may .profile
>> and my .login well before the session is even partially ready.
>According to the lead Plasma dev, KDE should not source .profile.

I happen to agree with him.  But, that's not my experience using KDE SC 4 on 
Ddebian Squeeze.  The file /etc/kde4/kdm/Xsession installed by the kdm 
package contains the following (plus other stuff):
# Note that the respective logout scripts are not sourced.
case $SHELL in
    [ -z "$BASH" ] && exec $SHELL $0 "$@"
    set +o posix
    [ -f /etc/profile ] && . /etc/profile
    if [ -f $HOME/.bash_profile ]; then
      . $HOME/.bash_profile
    elif [ -f $HOME/.bash_login ]; then
      . $HOME/.bash_login
    elif [ -f $HOME/.profile ]; then
      . $HOME/.profile
    [ -z "$ZSH_NAME" ] && exec $SHELL $0 "$@"
    emulate -R zsh
    [ -d /etc/zsh ] && zdir=/etc/zsh || zdir=/etc
    # zshenv is always sourced automatically.
    [ -f $zdir/zprofile ] && . $zdir/zprofile
    [ -f $zhome/.zprofile ] && . $zhome/.zprofile
    [ -f $zdir/zlogin ] && . $zdir/zlogin
    [ -f $zhome/.zlogin ] && . $zhome/.zlogin
    setopt shwordsplit noextendedglob
    # [t]cshrc is always sourced automatically.
    # Note that sourcing csh.login after .cshrc is non-standard.
    xsess_tmp=`mktemp /tmp/xsess-env-XXXXXX`
    $SHELL -c "if (-f /etc/csh.login) source /etc/csh.login; if (-f ~/.login) 
source ~/.login; /bin/sh -c export -p >! $xsess_tmp"
    . $xsess_tmp
    rm -f $xsess_tmp
  *) # Plain sh, ksh, and anything we do not know.
    [ -f /etc/profile ] && . /etc/profile
    [ -f $HOME/.profile ] && . $HOME/.profile
Boyd Stephen Smith Jr.                   ,= ,-_-. =.
bss at                   ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy         `-'(. .)`-'                    \_/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <>
-------------- next part --------------
This message is from the kde mailing list.
Account management:
More info:

More information about the kde mailing list