10 ms·
What it actually means is that it needs the various XDG basedir variables to be set, which they sometimes aren't in a non-desktop session (this is becoming less
by scrollaway 12y ago
What it actually means is that it needs the various XDG basedir variables to be set, which they sometimes aren't in a non-desktop session (this is becoming less common).
http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html http://standards.freedesktop.org/basedir-spec/basedir-spec-l...
xdg-mime merely looks at the shared-mime-info db, processes files accordingly and spits out the result.
Also, I did not actually say you should use xdg-mime; I said you should use the shared-mime-info database. xdg-mime is a (very crappy) interface for it, but using an xdg library is a lot, lot more efficient.
- Karellen 12y agoThanks for the reply. If not xdg-mime(1) then, do you know of another file(1)-like command-line app which does use the shared-mime-info database?
- scrollaway 12y agoFor use on the command line, feel free to use xdg-mime (it does not just do mime types, it also does associations with them which means you can view and change associations between file types from it). I don't know of any other tool like it although I was working on one in python (but it's not production ready).