WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: pcmanfm - possible fix for your missing mime types  (Read 89 times)

Offline aus9

  • Full Member
  • ***
  • Posts: 176
pcmanfm - possible fix for your missing mime types
« on: July 26, 2020, 10:48:44 PM »
OK

Firstly I was inspired by GNUser (currently) private package for tinyopen.

There are some tricks here so forgive me if you already know this.

A You may have a TCE loading in your boot list
B You may TCE loading from ~/X.d  (maybe calling a ~/.local/bin file?)
C Manually loading a TCE

current pcmanfm does not refresh your mime types. No-one has noticed  ;D

Here is a possible fix.

Code: [Select]
tce-load -i desktop-file-utils shared-mime-info
sudo update-mime-database /usr/local/share/mime/
sudo update-desktop-database /usr/local/share/applications/

Now because I use various boot lists, I may be my worse enemy here. But I was mislead somewhat by noticing a pesky firefox web browser changing the time stamp and contents of a file I had under .config

It is taken me this long to find the following (YMMV)
-- you do not need local mimeapps.list and related files

If you manually load a TCE and clicking on a file in pcmanfm does not auto open your app,
you repeat above commands,
until I provide an updated install script
or better make a .local/bin by providing a shebang.

so with pcmanfm open.....I loaded feh and mtpaint....and they appeared in my context menu without closing and re-opening pcmanfm

It is still not perfect but for main files like most audio video text files, mime handling appears OK with this fix.

Hope that helps.

PS spacefm has those 2 TCEs either in the dep file or recursive and install script
refreshes those databases.

I have not tested the loading of a package after loading spacefm as this is not about that TCE
but anyone building a new filemanager might like to have a gander at coreplayer2's install script.

Thanks for reading

If you do want to change the order of choices to open a file, then sure you are likely going to need to do a lot more with mime handling. Thats above my payscale ATM  ;D

Offline aus9

  • Full Member
  • ***
  • Posts: 176
Re: pcmanfm - possible fix for your missing mime types
« Reply #1 on: July 31, 2020, 01:34:24 AM »
if anyone is interested, I tested that possible fix against both pcmanfm and spacefm.
FM=file manager.....exe=executable........It works as expected.

Full reboot with not all TCEs in your boot list but with either pcmanfm or spacefm in list.
open either FM and for a right hand mouse user RH click to bring up context menu.

For any association already setup ....that menu will offer a choice of exes or only one.
So clicking that file will open the first named exe

Now load a rival app that can open that file type.
With either FM open....no extra exe appears in menu.
Run possible fix command -> the context menu changes to offer that new exe

I plan to submit a TCE called update-desktops that might assist users of these FMs YMMV

Thanks for reading