Default applications: Difference between revisions
(Correct the mupdf path) |
Prabuanand (talk | contribs) (replaced Category:Desktop as per Help_talk:Style) |
||
(11 intermediate revisions by 5 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 | 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. | ||
= Example = | For programs that do not ship a desktop entry file, one must be created. | ||
== Example == | |||
{{ | |||
< | The following example makes {{Pkg|mupdf}} the default command to open pdf files. | ||
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 11: | Line 15: | ||
Exec=/usr/bin/mupdf-gl | Exec=/usr/bin/mupdf-gl | ||
Name=mupdf | Name=mupdf | ||
</ | </nowiki> | ||
}} | |||
Use <code>xdg-mime</code> from {{Pkg|xdg-utils}} 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}} | ||
[ | == See also == | ||
[[Category: | |||
* [https://wiki.archlinux.org/title/Default_applications ArchWiki: Default applications] | |||
[[Category:System Administration]] |
Latest revision as of 16:13, 25 May 2025
To change the default application associated with a filetype you must use the xdg-mime command and point to the desired desktop file.
For programs that do not ship a desktop entry file, one must be created.
Example
The following example makes mupdf the default command to open pdf files.
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
Use xdg-mime
from xdg-utils to associate the desktop file with the pdf extension:
$ xdg-mime default mupdf.desktop application/pdf