Distribution or User wants to set his own XDG_DATA_DIRS but he can't because startxfce4 overwrites the variable. Reproducing: 1. Close X. Close Xfce4. Back to Console. 2. export XDG_DATA_DIRS="/usr/kde/3.5/share" 3. startxfce4 (or startx) 4. echo $XDG_DATA_DIRS It's gone now and xfdesktop does not find .desktop files from /usr/kde/3.5/share/applications. startxfce4 seems to do some weird checking.. including a simple patch to fix this issue.
Created attachment 1016 xfce-utils-4.4.0-xdg_data_dirs.patch
In the case where XDG_DATA_DIRS is not set, your patch causes the value to be invalid, with two consecutive colons. Not sure what the problem is, anyway: it should have the correct behavior as-is.
Works just fine here. What's your system, can you check the link /bin/sh? Debian based system uses /bin/dash which seems to cause some trouble
Created attachment 1017 Syntax tweaking I personally prefer the syntax "x" rather than x"", although it should not make any difference. Does that patch make any difference in your case?
Nice Olivier, it works. drac@unique ~ $ echo $XDG_DATA_DIRS /usr/kde/3.5/share:/usr/share drac@unique ~ $ bash --version GNU bash, version 3.2.9(1)-release (i686-pc-linux-gnu) Copyright (C) 2005 Free Software Foundation, Inc. drac@unique ~ $ ls -l /bin/sh lrwxrwxrwx 1 root root 4 2007-01-01 09:03 /bin/sh -> bash Thanks again, drac
Also, when you commit that change I'd suggest you include ~/.local/share and /usr/local/share in XDG_DATA_DIRS too. They are part of the f.d.o spec. Thanks, drac
(In reply to comment #6) > Also, when you commit that change I'd suggest you include ~/.local/share and > /usr/local/share in XDG_DATA_DIRS too. > > They are part of the f.d.o spec. Not sure, according to the spec[1], there is no mention of ~/.local/share, just /usr/local/share/ and /usr/share/ which are the ones we list. [1] http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html#variables
You're right, ~/.local/share/applications is $XDG_DATA_HOME but <quote> $XDG_DATA_DIRS defines the preference-ordered set of base directories to search for data files in addition to the $XDG_DATA_HOME base directory. The directories in $XDG_DATA_DIRS should be seperated with a colon ':'. </quote> Which seems to return nothing. Does xfdesktop still read .desktop files from ~/.local/share/applications?
Meh, asking stupid. Allready answered to myself, yes it does read ~/.local/share/applications. But XDG_DATA_DIR check startxfce4 uses /usr/local only in one count now, it should include it in both counts. Otherwise your patch is fine.
(In reply to comment #9) > But XDG_DATA_DIR check startxfce4 uses /usr/local only in one count now, it > should include it in both counts. Sorry, I don't know what you're trying to say here.
(In reply to comment #10) > (In reply to comment #9) > > > But XDG_DATA_DIR check startxfce4 uses /usr/local only in one count now, it > > should include it in both counts. > > Sorry, I don't know what you're trying to say here. > Is now, if test "x$XDG_DATA_DIRS" = "x" then XDG_DATA_DIRS="/usr/share:/usr/local/share:/usr/share" else XDG_DATA_DIRS="$XDG_DATA_DIRS:/usr/share" fi export XDG_DATA_DIRS Should be, if test "x$XDG_DATA_DIRS" = "x" then XDG_DATA_DIRS="/usr/local/share:/usr/share:@datadir@" else XDG_DATA_DIRS="$XDG_DATA_DIRS:/usr/local/share:/usr/share:@datadir@" fi export XDG_DATA_DIRS Include allways /usr/local and before /usr, in same order $PATH acts.
Right, you're correct, /usr/local should be first (but it has nothing to do with $PATH; the XDG basedir spec says /usr/local should be first).
(In reply to comment #12) > Right, you're correct, /usr/local should be first (but it has nothing to do > with $PATH; the XDG basedir spec says /usr/local should be first). > Yeah.. $PATH was poor example, has nothing do with it.. ;)
Created attachment 1049 xfce-utils-4.4.0-xdg_data_dirs.patch Upsdate to previous "Syntax tweaking" patch so that it allways includes /usr/local and before /usr as per freedesktop.org basedir specification. Only problem now is that it adds /usr and /usr/local twice if @datadir@ is same but that's no regression to what it allready does. Cosmetic problem.
That patch won't apply because syntax tweaking patch has been already applied to SVN. But beside that, I'm not very confirtable with that patch, precisely because it adds /usr and /usr/local to the already set $XDG_DATA_DIRS. The spec says: "If $XDG_DATA_DIRS is either not set or empty, a value equal to /usr/local/share/:/usr/share/ should be used." Therefore I think that if the user sets $XDG_DATA_DIRS, (s)he is supposed to set it correctly and therefore include /usr and /usr/local in the list. I mean, if the user sets the variable on purpose, it's up to him/her to make sure (s)he set it correctly. The script should not change what the user has specified except add the part that strictly necessary for the installation of xfce. Think of regular PATH here, a script doesn't add /bin and /usr/local/bin to a user set PATH.
/usr/local/share is now first in list as per comment #12.
As of recent change it appears now: if test "x$XDG_DATA_DIRS" = "x" then XDG_DATA_DIRS="usr/local/share:/usr/share://usr/share" else XDG_DATA_DIRS="$XDG_DATA_DIRS:/usr/share" fi export XDG_DATA_DIRS drac@unique ~ $ echo $XDG_DATA_DIRS usr/local/share:/usr/share://usr/share So it's missing a / and another one has double //
Meuuuuuh, it's a stupid typo... Fixed in rev. 25536