xdg-mime default nvim.desktop text/plain
Default Applications
Using CLI Utils
1 |
|
We can get the file’s mime-type through xdg-mime query filetype /path/to/the/file
, and using xdg-mime default <application> <mimetype(s)>
to set the default application for those files.
Note: application
is a .desktop file.
(Alternative) Edit mimeapps.list Manually
If you want to edit configuration manually or feel really desperate, just modify the ~/.config/mimeapps.list
manually.
Format:1
application/TYPE=LAUNCHER.desktop
Just add it under the [Default Applications]
section if you
want to be default, or under the [Added Associations]
section if it shouldn’t be default.
Note: Some programs still use the now deprecated ~/.local/share/applications/mimeapps.list
, however the best is to make that a symlink to ~/.config/mimeapps.list
to have a single config for this:
1 |
|
Reference
Change Default Applications
http://example.com/2022/10/06/default_applications/