How to change the default program for a chosen file type system-wide in kde or xfce?

I would like to have files of a chosen type (by their extension) to open with some specific programs. Which configuration files do I need to edit?
I’ve tried some in /usr/share/appplications/default.list but it doesn’t work.

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

Have a look at the file $HOME/.local/share/applications/defaults.list

There is a section [Default Applications] to specify the programs for particular mime types. You can add for example:

application/x-debian-package=gdebi.desktop

The .desktop files can be found in /usr/share/applications/ or you can create your own files under $HOME/.local/share/applications/. To find out the mime type of the files, run

file --mime-type <some_file>

Alternatively, in KDE one can accomplish the same in GUI in File Associations inside System Settings.


To register a MIME type for an extension see freedesktop.org – AddingMIMETutor and stackoverflow – Register file extensions / mime types in Linux.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x