Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Post History

71%
+3 −0
Q&A How to change the default app for opening directories in Gnome?

By digging further into the details of xdg-open, I stumbled upon this page in the Arch wiki. There it states that xdg-open will delegate the task of opening a file to the handler of the Desktop En...

posted 9mo ago by mr Tsjolder‭

Answer
#1: Initial revision by user avatar mr Tsjolder‭ · 2023-08-14T08:37:09Z (9 months ago)
By digging further into the details of `xdg-open`, I stumbled upon this [page](https://wiki.archlinux.org/title/Xdg-utils#xdg-open) in the Arch wiki.
There it states that `xdg-open` will delegate the task of opening a file to the handler of the Desktop Environment (DE).
In the case of Gnome, this will be `gio`.

### My Solution

The available applications for opening a directory can be listed using
```
gio mime inode/directory
```
This effectively listed vscode as the default app!
I eventually managed to overwrite this default to use Nautilus as follows
```
gio mime inode/directory org.gnome.Nautilus.desktop
```

### General Solution

I am not sure how `xdg-mime` and `gio` got disconnected.
I verified that `xdg-mime` also correctly delegates to `gio` and there seem to be no problems there (at least after the fix).
Therefore, a more general (DE-independent) fix would probably be to use
```
xdg-mime default org.gnome.Nautilus.desktop inode/directory
```
to set the default app, even if `xdg-mime query default` lists the correct result.
After all, `xdg-mime` does seem to correctly delegate to the app used by the DE.