You are not logged in.
Pages: 1
Topic closed
My computer insists on trying to open PDFs in Librewolf (lol). I use i3wm. KDE is also installed, but not currently used.
I tried setting it to Zathura in a few GUI places (don't remember exactly where) but it seems to not have worked. Naturally I checked "/.config/mimeapps.list".
[Default Applications]
text/html=chromium.desktop
x-scheme-handler/http=chromium.desktop
x-scheme-handler/https=chromium.desktop
x-scheme-handler/about=chromium.desktop
x-scheme-handler/unknown=chromium.desktop
application/pdf=zathura.desktop
[Added Associations]
application/pdf=org.pwmt.zathura-pdf-mupdf.desktop;mupdf.desktop;Everything seems fine here. I then used the query command:
$ XDG_UTILS_DEBUG_LEVEL=2 xdg-mime query default application/pdf
Checking ~/.config/mimeapps.list
Checking ~/.local/share/applications/defaults.list and ~/.local/share/applications/mimeinfo.cache
librewolf.desktopAha! This must be the problem. This mysterious mimeinfo.cache is not mentioned in https://wiki.archlinux.org/title/XDG_MIME_Applications at all, and searching around I found an ancient forum post about it: https://forums.fedoraforum.org/showthre … -Gnome-2-8 This didn't really explain much but I took away that mimeinfo.cache is some kind of generated file. I tried "update-mime-database" but that asks for a directory, so I decided it's just for installing new mime types and gave up on it. I then tried "update-desktop-database":
$ update-desktop-database
The databases in [/usr/local/share/applications, /usr/share/applications] could not be updated.
$ sudo update-desktop-databaseHowever this did not change mimeinfo.cache nor the outcome of querying pdf. I then wondered if this whole XDG MIME business is just an overcomplicated, broken POS and deleted mimeinfo.cache. Funnily enough, this made some progress: update-desktop-database does not re-create it, and also PDFs now open with chromium rather than Librewolf:
$ XDG_UTILS_DEBUG_LEVEL=2 xdg-mime query default application/pdf
Checking ~/.config/mimeapps.list
Checking ~/.local/share/applications/defaults.list and ~/.local/share/applications/mimeinfo.cache
Checking ~/.local/share/applications/defaults.list and ~/.local/share/applications/mimeinfo.cache
Checking /usr/local/share//applications/defaults.list and /usr/local/share//applications/mimeinfo.cache
Checking /usr/local/share//applications/defaults.list and /usr/local/share//applications/mimeinfo.cache
Checking /usr/share//applications/defaults.list and /usr/share//applications/mimeinfo.cache
chromium.desktopNote that "~/.local/share/applications/defaults.list" and "~/.local/share/applications/mimeinfo.cache" do not exist.
Unfortunately, my goal is for XDG to honor the ~/.config/mimeapps.list entry for Zathura. So what is going on here and how can I fix it?
Last edited by lfitzgerald (2022-08-23 17:21:45)
Offline
Oh, one more thing: After being frustrated by this nonsense, I went ahead and created a file at "~/.local/share/applications/mimeinfo.cache":
$ cat ~/.local/share/applications/mimeinfo.cache
[MIME Cache]
application/pdf=zathura.desktop;This seemingly fixed my issue:
$ xdg-mime query default application/pdf
Checking ~/.config/mimeapps.list
Checking ~/.local/share/applications/defaults.list and ~/.local/share/applications/mimeinfo.cache
zathura.desktopBut is this really the fix? The file is called "cache" and it's in "share", so sounds like this is not meant to be edited directly. If I go ahead and check this into my dotfiles, and start adding all my customization to it, will something break down the line?
Offline
According to https://bbs.archlinux.org/viewtopic.php?id=97886 (who did use the same fedora post) there's a better solution .
create a defaults.list with your desired associations .
Last edited by Lone_Wolf (2022-08-24 14:25:30)
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
I just got here via google, having a similar problem to the title where files in qbittorrent were opening in a browser, the solution was to delete the catchall: x-scheme-handler/file= in ~/.config/mimeapps.list and then:
$ update-mime-database ~/.local/share/mime/This should help passerbys with the same problem!
Offline
Please refrain from necrobumping.
Closing.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
Pages: 1
Topic closed