Default applications

Erik Harrison erikharrison at gmail.com
Wed Aug 29 03:10:53 CEST 2007


On 8/28/07, Steve Cayford <cayfo001 at umn.edu> wrote:
>SNIP
> >
> > Alrighty. Let's dig a little. What is the value of $XDG_DATA_DIRS in
> > your environment?
>
> This is not set. I don't see any XDG environment variables at all.
>

Bingo.

> > If you strace Thunar starting up, grepping for opens, do you see it
> > open any defaults.list file in any new locations?
>
> Ah. First it looks in ~/.local/share/applications/defaults.list, then
> /usr/share/applications/defaults.list (which indicates gedit.desktop), then
> /usr/local/share/applications/defaults.list (which does not exist).
>

Xubuntu sets XDG_DATA_DIRS, and then places it's system wide configs
appropriately. Since XDG_DATA_DIRS isn't set, Thunar looks for the
files in the standard XDG locations, where there are no defaults. This
is as per the XDG spec.

What Thunar's behavior is at this point, I'm not sure, but my guess is
it casts about for the first .desktop file is can find that supports
the MIME type. That's why Emacs opens up

> gedit.desktop points to gedit, but gedit is not installed on here. So I
> suppose I should edit /usr/share/applications/defaults.list? Can I just
> symlink that to /etc/xdg/xubuntu/applications/defaults.list?
>

Yes, but you shouldn't. That only fixes Thunar - all the other Xubuntu
customized packages that use XDG won't be able to find their
systemwide defaults.

I'm not sure where Xubuntu sets XDG* but you said this was an LTSP
customized setup? You've probably changed how the X login process
works, replacing the chunk of xinit that sets the vars to what Xubuntu
expects.

On my Xubuntu system XDG_DATA_DIRS is set to:
/etc/xdg/xubuntu:/usr/share:/usr/local/share:/usr/share

Set up the environment to match that at login and you should be golden.


> > After running thunar, and opening a text file with Emacs, what is the
> > contents of the user's defaults.list?
>
> Just opening the file with either editor doesn't seem to have any effect. If I
> then look under the file's properties and select the open with emacs option,
> the defaults.list becomes "text/plain=emacs21.desktop"
>
> > Xubuntu shouldn't have emacs anywhere in the system defaults.list. Does yours?
>
> I find three system files named "defaults.list":
> /usr/share/applications/defaults.list and /etc/gnome/defaults.list both
> indicate gedit.desktop for text/plain while
> /etc/xdg/xubuntu/applications/defaults.list indicates mousepad.desktop. None
> of the files have any references to emacs.
>
> > Does Mousepad run on this machine?
>
> Yes.
>
> > If you run Thunar from a terminal, does it bitch when trying to open the file?
>
> No output at all. Just opens it with emacs.
>
> > And, what is the exact mime type of the file as reported in the
> > properties dialog?
>
> The properties dialog says "plain text document", but the local defaults list
> then shows the entry under "text/plain".
>
> > Not saying that I have any idea what the culprit is, but I'll try to
> > help you hunt it down.
>
> Thanks for any suggestions. For now I'm just putting the mousepad entry in the
>  skeleton files.
>
> --Steve
> _______________________________________________
> Xfce mailing list
> Xfce at xfce.org
> http://foo-projects.org/mailman/listinfo/xfce
> http://www.xfce.org
>


-- 
Erik
"If you want to go somewhere, goto is the best way to get there." - Ken Thompson



More information about the Xfce mailing list