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

Adding a shared XDG data directory (mime, icons, ...)

Tags: None
(comma "," separated)
petej
Registered Member
Posts
10
Karma
0
OS
This question is somewhere between OS and KDE, but since I feel the solution might consist of one short KDE script, I'll ask it here:

My situation:
One directory that gets shared to a lot of Kubuntu 12.04.4 clients (KDE 4.8.5), mounted on /usr/mycompany

What I want:
KDE should use icons, mime, ... from /usr/mycompany/share

What I tried:
1) Adding this path this path to /etc/kde4rc under 'prefixes' or 'xdgdata-mime'. Doesn't seem to have any effect.
2) Edit /etc/environment and add line 'XDG_DATA_DIRS="/usr/share/default:/usr/local/share/:/usr/share/:/usr/mycompany/share" '. Does work, but overrides any changes to the default paths which might change in future Kubuntu distributions (i.e. this breaks with upstream)
3) Edit /etc/environment and add line 'XDG_DATA_DIRS="$XDG_DATA_DIRS:/usr/mycompany/share" '. Now this doesn't work, as the shell variable does not get expanded, but interestingly enough, /usr/share/default will be in $XDG_DATA_DIRS anyway.

My question:
How do I add directories to $XDG_DATA_DIRS without breaking with upstream respectivly how did /usr/share/default get in there?
luebking
Karma
0
try: ~/.kde/env/xdg_path.sh
Code: Select all
#!/bin/sh
export XDG_DATA_DIRS="$XDG_DATA_DIRS:/usr/mycompany/share"


ensure to "chmod +x ~/.kde/env/xdg_path.sh"
petej
Registered Member
Posts
10
Karma
0
OS
luebking wrote:try: ~/.kde/env/xdg_path.sh


If that works, it only works for my account. As always, we are looking for a global aka. "affects all users on the system wheter they like it or not" solution.
luebking
Karma
0
Well, you didn't mention that.
-> Tried a scriptlet in /etc/profile.d/ ?

NB.
a) /etc/environment is *meant* to be altered downstream.
Your distro should be able to notice and offer to resolve pot. version conflicts.
b) you can pass envfile=/etc/environment.system to pam_env that sources /etc/environment.system and eg. /etc/environment.local (source may not work, never tried. but you could build the file by an early system service)
c) "wheter they like it or not" - you're hopefully aware that you can pretty much forget about this unless you're willing to completely castrate user permissions?


Bookmarks



Who is online

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