Default applications

From Alpine Linux
Revision as of 18:03, 31 August 2016 by Ant4 (talk | contribs) (Created page with "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)...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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.

$ cat > ~/.local/share/applications/mupdf.desktop

[Desktop Entry]
Type=Application
Terminal=false
Exec=/usr/local/bin/mupdf
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.