Default applications: Difference between revisions
No edit summary |
m (minor formatting) |
||
(4 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
To change the default application associated with a filetype you must use the xdg-mime command and point to the desired desktop file (if it doesn't exist, you must create one). | To change the default application associated with a filetype you must use the [https://linux.die.net/man/1/xdg-mime xdg-mime] command and point to the desired desktop file (if it doesn't exist, you must create one). | ||
== Example == | |||
In the following example we want to make mupdf the default command to open pdf files. | In the following example we want to make mupdf the default command to open pdf files. | ||
First you need to create a desktop file, because mupdf doesn't provide one. | First you need to create a desktop file, because mupdf doesn't provide one. | ||
{{cat|~/.local/share/applications/mupdf.desktop|<nowiki> | |||
[Desktop Entry] | [Desktop Entry] | ||
Type=Application | Type=Application | ||
Line 16: | Line 17: | ||
Then you must use xdg to associate the desktop file with the pdf extension. | Then you must use xdg to associate the desktop file with the pdf extension. | ||
{{Cmd|$ xdg-mime default mupdf.desktop application/pdf}} | {{Cmd|$ xdg-mime default mupdf.desktop application/pdf}} | ||
That's all. | That's all. | ||
== See also == | |||
* [https://wiki.archlinux.org/title/Default_applications ArchWiki: Default applications] | |||
[[Category:Desktop]] | [[Category:Desktop]] | ||
[[Category:Newbie]] | |||
[[Category:Installation]] | [[Category:Installation]] |
Latest revision as of 18:48, 17 April 2023
To change the default application associated with a filetype you must use the xdg-mime command and point to the desired desktop file (if it doesn't exist, you must create one).
Example
In the following example we want to make mupdf the default command to open pdf files.
First you need to create a desktop file, because mupdf doesn't provide one.
Contents of ~/.local/share/applications/mupdf.desktop
[Desktop Entry]
Type=Application
Terminal=false
Exec=/usr/bin/mupdf-gl
Name=mupdf
Then you must use xdg to associate the desktop file with the pdf extension.
$ xdg-mime default mupdf.desktop application/pdf
That's all.