1

I'm trying to change the default program to open PDF files with xdg-open using the command xdg-mime default pdf.desktop application/pdf.

The file pdf.desktop is already in ~/.local/share/applications.

Summary of what I've tried

rik@arch ~ : xdg-mime query default application/pdf
firefox.desktop
rik@arch ~ : xdg-mime default pdf.desktop application/pdf
rik@arch ~ : xdg-mime query default application/pdf
firefox.desktop
rik@arch ~ : update-desktop-database ~/.local/share/applications
rik@arch ~ : xdg-mime query default application/pdf
firefox.desktop
rik@arch ~ : xdg-mime default pdf.desktop application/pdf
rik@arch ~ : xdg-mime query default application/pdf
firefox.desktop

I can change it with these steps if I put the pdf.desktop file in /usr/share/applications.

Content of pdf.desktop

[Desktop Entry]
Type=Application
Name=Zathura
Exec=zathura

I'm using Arch Linux (up-to-date).

What can I try to set pdf.desktop as default for application/pdf without moving any file to /usr/share/applications?

1 Answer 1

0

I've managed to solve this issue by correctly setting the XDG variables:

export XDG_DATA_HOME="$HOME/.local/share"
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_CACHE_HOME="$HOME/.cache"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .