I'm using openbox as a window manager without any desktop environment on multiple Linux distributions. But at the moment I'm using Mageia Linux Release 5. Most of the time I don't notice xdg because I open those applications I haven't defined keybindings for in my ~/.config/openbox/rc.xml, either from the command line or with midnight commander. Which has it's own method of assigning default applications.
But at least some of the applications I use depend on xdg to open other applications. For example when the lyx document processor opens a pdf to view the current output of the current document. It was using the gimp.
{I like okular for this even though I can't stand the KDE environment itself since kde4. Never could stand gnome so I wound up using openbox}
I did some web searching and learned to test xdg in a terminal with
Code:
xdg-open testfile.pdf
which also opened the pdf with gimp.
After some more web searching I tried editing the file
~/.config/mimeapps.list (which hadn't specified a pdf application or hardly anything else)
I added one line so that it now contained:
Code:
[Default Applications]
inode/directory=pcmanfm.desktop
application/pdf=okular.desktop
[Added Associations]
inode/directory=pcmanfm.desktop;
This had no effect on the application used by xdg-open to open a pdf file.
After some more web searching I tried to follow the instructions on the Arch wiki:
This command did work to set the default to Evince {which is somewhat better than opening a pdf with the gimp. But I wanted okular}
Code:
xdg-mime default evince.desktop application/pdf
So I tried:
Code:
xdg-mime default okular.desktop application/pdf
But when I tested it with:
Code:
xdg-open testfile.pdf
I got a blank okular display window with this error message:
http://oi64.tinypic.com/29olh80.jpg
Yet from the same xterm {in the same directory}
Code:
okular testfile.pdf
opens the test pdf properly with okular.
As does selecting the file in midnight commander and hitting Enter with this:
Code:
# PDF
type/^PDF
Open=(okular %f &)
in my ~/.config/mc/mc.ext file...
What can I do {besides installing the entire KDE desktop environment} to get xdg-open to succesfuly open a pdf with okular???