[HOW-TO] Set default applications in xfce

Hello, if you have tried to set a default application in zorin os lite/xfce, you would find that it is a bit tricky for some apps. This tutorial is going to help you set a default applications in xfce.

Let's discuss the easy ones first. If you open your menu and search for preferred applications and open it, you will find that you can set default applications there. But you can only set four of them which are web browser, mail reader, file manager and terminal emulator. Setting default applications from there is as easy as abc. But if you want to set the default for other functions such as a mp4 file or a jpg, you can read the rest of this tutorial and find out how.

Let us set the default app for a jpg file. We can use the following steps to do that.

• First we need to find out the mime type of the jpg file. Normally, the
structure of a mime type is type/subtype. Let's use a jpg file I have to
find its mime type. For that I will go to terminal and enter the command
file --mime-type /home/jeslin/Pictures/example.jpg or xdg-mime query filetype /home/jeslin/Pictures/example.jpg. I will get the
output as /home/jeslin/Pictures/example.jpg: image/jpeg. Here,
'image/jpeg' is the mime type of my jpg file.

•Now that we have it's mime type, I can find what application is set to open this mime. For that I will use the command xdg-mime query default image/jpeg and I will get the output as org.gnome.eog.desktop . This is the default one. We are going to set it to gimp.

•To change the application from org.gnome.eog.desktop to gimp.desktop, we can use the command xdg-mime default gimp.desktop image/jpeg. If it goes right, it will give no output.

•To make sure that it worked, you can use the xdg-mime query default image/jpeg command again and it will give the output as gimp.desktop.

Now if you open a jpg file, it will be opened in gimp.

Some common mime types and applications:

Note: The structure of the text given below is x: y, where 'x' is the format of the file, 'y' is the mime type.

.jpg: image/jpeg
.png: image/png
.mp4: video/mp4
.mp3: audio/mp3
.pdf: application/pdf
text: text/plain

If you need to find the application associated with the mime type, you can use the xdg-mime query default type/subtype command on a file or you could look for it in here:

https://www.iana.org/assignments/media-types/media-types.xhtml#audio

I hope that you found this useful.
Have a good day. :grinning:

EDIT:
An easier way to find the related application, go to /usr/share/applications/. You will find every one of them there.

5 Likes

7 posts were split to a new topic: Discussing [HOW-TO] Set default applications in xfce