I’m working on different Linux distributions.
.bashrc I’d like to set up an alias that opens a window of the default file manager (e.g.
Is there a way find out what the file-manager of a session is? (It does also depends on the session, doesn’t it?)
Here is Solutions:
We have many solutions to this problem, But we recommend you to use the first solution because it is tested & true solution that will 100% work for you.
As comments have already stated, you’re probably better off with
xdg-open (no alias needed), but to answer the question: You can use
xdg-mime to query and set default applications. To get the default file manager:
xdg-mime query default inode/directory
No, you can’t.
Or at least there’s no simple magic command for guessing what’s the current desktop’s default file manager.
xdg-mime query will do or tell you, is what has been associated to the desktop object type "folder" (inode/directory type), for the action "open". This is neither what defines a file manager in general, nor what defines what’s the desktop’s default one or what you expect.
What is associated to the inode/directory type could be whatever application you’ve installed that associates itself to directories (audacious does it – is that the file manager you’d expect? it’s not the only one).
Note: Use and implement solution 1 because this method fully tested our system.
Thank you 🙂