You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That makes a number of assumptions that may work in some scenarios, but not in others:
xdg-mime is installed and configured correctly.
gtk-launch is installed and configured correctly.
While this probably works on a default GNOME or Xfce4 installation, it may not work at all or only partially on KDE Plasma or on other, more exotic desktops.
Also, it needs several indirections before the interesting thing is started: Your file manager.
In a real-world setup, it would have to do that xdg-mime query default inode/directory the first time that %filemanager macro is used and - importantly - log the result to give the user a fighting chance to do something in case it didn't work as expected.
Using %p instead of %d again makes an assumption: That the file manager that was picked up actually behaves like you described, to set the keyboard focus in the newly opened window to that file, and not simply execute it instead (if it is an executable) or start the associated application if it's a known MIME type that has one.
I'd really hate to get LibreOffice started with a spreadsheet or a text document that I had selected when I just want to open a file manager there.
If you know that this works in your environment, you are free to change the command line for the "Open File Manager here" cleanup action in the "Cleanup Actions" configuration dialog to the one you proposed here.
But I don't think that would be a good default for all users.
In Ubuntu 20.04, it is possible to query the default file manager like so:
then, launching it is as simple as
$ gtk-launch `xdg-mime query default inode/directory`
and focusing a file is:
$ gtk-launch `xdg-mime query default inode/directory` '/path/to/file'
Somehow, even though here it says
qdirstat/README.md
Lines 645 to 646 in 8174478
the
nautilus
I have (but barely use) is not picked up.Then, the default action (except probably
xdg-open
) can be changed to%filemanager %p &
and the file manager will open and be focused.The text was updated successfully, but these errors were encountered: