Default File Manager
s.jansen at gmail.com
Tue Nov 29 19:23:26 PST 2011
On Tue, Nov 29, 2011 at 6:32 PM, Thiago Macieira <thiago at kde.org> wrote:
> On Tuesday, 29 de November de 2011 15.57.51, Sander Jansen wrote:
>> Is there a cross-desktop way of determining the default file manager
>> to use? I want to show show a specific folder and/or file in the file
>> manager. I was hoping to perhaps use the mimeinfo.cache /
>> mimeapps.list / defaults.list to find this out, but not sure how
>> cross-desktop this really is (and what mimetype to check for:
>> x-directory, inode-directory?).
>> Or should I use something more elaborate, like determining the current
>> desktop environment (is there a standard for doing this, I know some
>> set DESKTOP_SESSION in the environment) and guess from there.
> What happens if you xdg-open the directory you want shown?
Looks like xdg-open with a directory works here (XFCE). Browsing
through the source of xdg-open, it seems to use whatever native
desktop tools available to open the directory (exo-open / gvfs-open /
kde-open...) or falls back to the "inode/directory" mimetype. In the
former case you cannot override the default file manager by using
defaults.list or mimeapps.list. I guess you have to use the GUI tools
to change that.
> I don't think there's any way to show a directory with a specific file selected.
> Maybe we could standardise on using the URL fragment for that purpose, e.g.:
> xdg-open file:///home/thiago/#valgrind.supp
> This URL above works right now, except it won't pre-select valgrind.supp.
That should only work if the input is an url. It shouldn't do the same
if file:/// is left out. A basic show-this-file in the browser would
be nice to have. I guess for more elaborate file operations a "file
manager dbus interface" will be better. Which gets us back to the
problem on how do determine what file manager to start in cross
desktop neutral way. It would be nice if we didn't need to use any of
the native tools (exo-open,gvfs-open) and just rely on the
inode/directory mimetype in the mimecache.
More information about the xdg