2

I associated pdf with Okular using mimeopen. Then I became curious where it had saved the configuration. My first guess was:

$HOME/.config/mimeapps.list

but it didn't contain the right entry. So I searched:

updatedb && locate mime | xargs egrep -e "okular" 2> /dev/null

and found nothing. So which file is used mimeopen to save associations?

update

I started digging, following a clue from cas's comment, and I found a file:

$HOME/.local/share/okular-usercreated-1.desktop.

with the content:

[Desktop Entry]
Version=1.0
Encoding=UTF-8
Type=Application
Name=okular
NoDisplay=true
Exec=okular

Which strangely does not have a MimeType record

My guess: Since I use openbox, which doesn't set $DE environmental variable mimeopen had been forced to create a new .desktop file when I used it. Which is inconvenient.

I read it is possible to run openbox inside other desktop environments. I will give it a try.

3
  • possibly ~/.local/share/applications/mimeinfo.cache. BTW, see man pages for mimeopen,update-mime-database, and update-desktop-database. See also man pages for xdg-open and xdg-mime and related programs. The freedesktop.org people have been busy little beavers making things as confusing and complicated as possible.
    – cas
    Jul 3, 2016 at 15:05
  • @cas Thanks you gave me a good direction to look
    – atevm
    Jul 3, 2016 at 15:51
  • 1
    If you end up finding an answer, please write it up and post it, then Accept your own answer. If it's a good answer, i'll upvote it (ping me with @cas in a comment).
    – cas
    Jul 4, 2016 at 7:07

1 Answer 1

2

I found the records:

mimeopen when no desktop environment is specified saves the records in:

$HOME/.local/share/applications/defaults.list

1
  • This isn't the location that xdg-open uses though!! Symlink it to ~/.config/mimeapps.list for the win.
    – Tom Hale
    May 29, 2017 at 6:56

You must log in to answer this question.

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