This forum has been archived. All content is frozen. Please use KDE Discuss instead.

[SOLVED] How to add a directory to KDEDIRS

Tags: None
(comma "," separated)
User avatar
jithin1987
Registered Member
Posts
135
Karma
0
OS
I am trying to add a directory to KDEDIRS.
I tried setting in /etc/kde4rc by editing this line
[Directories-default]
prefixes=/usr/share/kubuntu-default-settings/kde4-profile/default/

I changed it to prefixes=/usr/share/kubuntu-default-settings/kde4-profile/default/:/home/me/dev/plasmoids/

But this did not work ,but changing to prefixes=/home/me/dev/plasmoids/ worked

How can I just append to the prefixes. Please help


jithin1987, proud to be a member of KDE forums since 2008-Oct.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Edit ~/.bashrc
Add the following line, adjusting as needed.
Code: Select all
export KDEDIRS=$KDEDIRS:/home/me/dev/plasmoids


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
jithin1987
Registered Member
Posts
135
Karma
0
OS
bcooksley wrote:Edit ~/.bashrc
Add the following line, adjusting as needed.
Code: Select all
export KDEDIRS=$KDEDIRS:/home/me/dev/plasmoids



I tried that but then after I logged in and checked KDEDIRS in env it showed only :/home/me/dev/plasmoids and login took a lot of time and some of my settings were gone like gtk apps font, plasma bar height.


jithin1987, proud to be a member of KDE forums since 2008-Oct.
User avatar
anda_skoa
KDE Developer
Posts
783
Karma
4
OS
Correct, bashrc doesn't work for the non-interactive shell which is running startkde.

Generally, shell config/profile files only apply to that very shell, not to anyother, e.g. the generic /bin/sh link.

Therefore it is better to use the system's/distribution's way of setting the global environment, e.g. PAM, /etc/environment

For KDE you have the additional option of using KDE's environment extender mechanism, i.e. files (ending in .sh, don't need to be executable) put into an "env" subdirectory in any KDE directory, e.g. $KDEHOME/env

Example: adding a KDE prefix for just one user

Code: Select all
export KDEDIRS=/home/me/dev/plasmoids:$KDEDIRS

and put it into $KDEHOME/env, e.g. $HOME/.kde/env

Cheers,
_


anda_skoa, proud to be a member of KDE forums since 2008-Oct.
User avatar
jithin1987
Registered Member
Posts
135
Karma
0
OS
anda_skoa wrote:Correct, bashrc doesn't work for the non-interactive shell which is running startkde.

Generally, shell config/profile files only apply to that very shell, not to anyother, e.g. the generic /bin/sh link.

Therefore it is better to use the system's/distribution's way of setting the global environment, e.g. PAM, /etc/environment

For KDE you have the additional option of using KDE's environment extender mechanism, i.e. files (ending in .sh, don't need to be executable) put into an "env" subdirectory in any KDE directory, e.g. $KDEHOME/env

Example: adding a KDE prefix for just one user

Code: Select all
export KDEDIRS=/home/me/dev/plasmoids:$KDEDIRS

and put it into $KDEHOME/env, e.g. $HOME/.kde/env

Cheers,
_

Thanks that did the trick.


jithin1987, proud to be a member of KDE forums since 2008-Oct.
User avatar
Ahmad Samir
Registered Member
Posts
127
Karma
0
OS
FWIW you can add it to .bash_profile which gets executed when you login.

.bashrc is only executed when you start e.g. konsole, IIRC.
User avatar
jithin1987
Registered Member
Posts
135
Karma
0
OS
I noticed one thing.

env | grep -i kdedir
KDEDIRS=/home/jithine/dev/plasmoids:/usr/local:

This means that the initial value of KDEDIRS is empty. So am I doing the right thing by running

export KDEDIRS=/home/jithine/dev/plasmoids:/usr/local:$KDEDIRS

How do I get the original KDEDIRS value.


jithin1987, proud to be a member of KDE forums since 2008-Oct.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
kde4-config --prefix will tell you it.
It's a pity most distributions do not set the variable up correctly.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
jithin1987
Registered Member
Posts
135
Karma
0
OS
bcooksley wrote:kde4-config --prefix


I am a little bit confused.
kde4-config --prefix says /usr . But my env says $KDEDIRS is /home/jithine/dev/plasmoids:/usr/local:

How does these things fit into? I can see that my plasmoid in /home/jithine/dev/plasmoids is loaded.
So is KDEDIRS supposed to contain /usr (from kde4-config --prefix) or are they two entirely different parameters?


jithin1987, proud to be a member of KDE forums since 2008-Oct.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
The initial value of KDEDIRS is empty, although it should contain /usr.
If you follow the method provided by anda_skoa above, then the value will likely be set ( since KDE sets it up )


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
jithin1987
Registered Member
Posts
135
Karma
0
OS
bcooksley wrote:The initial value of KDEDIRS is empty, although it should contain /usr.
If you follow the method provided by anda_skoa above, then the value will likely be set ( since KDE sets it up )


I did it that way only putting in .kde/env . But KDEDIRS does not contain /usr


jithin1987, proud to be a member of KDE forums since 2008-Oct.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
When you set KDEDIRS, simply add /usr to it also in that case. I do not know why that happens.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
anda_skoa
KDE Developer
Posts
783
Karma
4
OS
The original $KDEDIRS is empty because it defaults to installation prefix anyway.

Or rather KDE will always search the installation prefix, independent on whether it is in KDEDIRS. You can put it in KDEDIRS if you want to have it searched at a specific level, i.e. not as the last possible option.

Cheers,
_


anda_skoa, proud to be a member of KDE forums since 2008-Oct.


Bookmarks



Who is online

Registered users: Bing [Bot], daret, Google [Bot], Sogou [Bot]