LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-10-2019, 01:38 PM   #1
Johncc330
Member
 
Registered: Mar 2007
Posts: 49

Rep: Reputation: 16
Midnight commander/ mime extensions configuration failing


I'm running Slackware64-current (fairly recent) and at some point, something went wrong. Midnight commander recognizes only some extensions, eg. .gz, .sch (geda schem), .gnumeric, ..., but many other not: eg. .zip, all image files, like .jpg, .png... F3 is calling to vim, instead of joe, which has been the setup for years.

I've tried to follow the 'logic' of the search for apps corresponding to the extensions. Loads of pages seem to have contradictory information, and there seem to be several flavors of mc around too.

There was originally a very old ~/.mc dir, which I archived.
Now there's an ~/.config/mc/mc.ext which seems to be called by mc, but doesn't seem to work entirely.

And, I have the impression that mc is giving priority to file mime-types, which don't seem to work correctly either. Mimeopen/xdg-open correctly open xpdf, but activating a .pdf in mc doesn't.

Can anyone point me to up-to-date and readable documentation on how the mimeopen/xdg-open mechanism should work? And how it collaborates with 'mc'? I've never really had problems in more than 20 years of Slackware use.
 
Old 05-11-2019, 09:38 AM   #2
vladimir1986
Member
 
Registered: Jul 2011
Posts: 77

Rep: Reputation: Disabled
Quote:
Originally Posted by Johncc330 View Post
I'm running Slackware64-current (fairly recent) and at some point, something went wrong. Midnight commander recognizes only some extensions, eg. .gz, .sch (geda schem), .gnumeric, ..., but many other not: eg. .zip, all image files, like .jpg, .png... F3 is calling to vim, instead of joe, which has been the setup for years.

I've tried to follow the 'logic' of the search for apps corresponding to the extensions. Loads of pages seem to have contradictory information, and there seem to be several flavors of mc around too.

There was originally a very old ~/.mc dir, which I archived.
Now there's an ~/.config/mc/mc.ext which seems to be called by mc, but doesn't seem to work entirely.

And, I have the impression that mc is giving priority to file mime-types, which don't seem to work correctly either. Mimeopen/xdg-open correctly open xpdf, but activating a .pdf in mc doesn't.

Can anyone point me to up-to-date and readable documentation on how the mimeopen/xdg-open mechanism should work? And how it collaborates with 'mc'? I've never really had problems in more than 20 years of Slackware use.
I might be wrong, but I always solved those issues with the extension config file for mc directly, I don't think MC works directly with mime-types.

Also, make sure to either use ~/.config/mc or ~/.mc. Otherwise you might be making changes in the file which hasn't priority
 
Old 05-11-2019, 01:22 PM   #3
Johncc330
Member
 
Registered: Mar 2007
Posts: 49

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by vladimir1986 View Post
I might be wrong, but I always solved those issues with the extension config file for mc directly, I don't think MC works directly with mime-types.

Also, make sure to either use ~/.config/mc or ~/.mc. Otherwise you might be making changes in the file which hasn't priority
I have:

Code:
type/^PDF
#       Open=/usr/libexec/mc/ext.d/doc.sh open pdf
        Open=xpdf %f > /dev/null 2>&1 &
        View=evince -w %f > /dev/null 2>&1 &
which doesn't work. But I now noticed that 'type/^PDF' takes its info from the 'file'
command, which doesn't seem to work:

Code:
/etc/file/magic/gnome-keyring, 11: Warning: Printf format is too long for type `byte' in description `, crypto type %hhu (unknown)'
/etc/file/magic/gnome-keyring, 13: Warning: Printf format is too long for type `byte' in description `, hash type %hhu (unknown)'
file: could not find any valid magic files! (Success)
I checked the version of the gnome-keyring library - was too old. I tried to upgrade the package, but it didn't install, claiming it was already up-to-date. Strange... Will have to investigate a bit more there, it seems. Strange 'mc' still confides in the 'file' command, I understand this command is somewhat outdated (and doesn't follow symlinks?)

Thanks for the suggestion!
 
Old 05-14-2019, 09:53 AM   #4
perseus12
Member
 
Registered: Oct 2012
Location: here and there
Distribution: Slackware Current, FreeBSD 12.0, LFS 8.4
Posts: 40

Rep: Reputation: Disabled
@Johncc330
I may have misunderstood your problem, but it does seem similar to one I've had with mc. For me just about any mimetype used to be opened by firefox. I did not like that at all and any edits I made to the local mc.ext file were ignored by the fact that xdg_open was overriding any choices I made locally.

I did some research but could not find much help with documentation around net so I decided to do politcally incorrect thing but it works for me.
I made a copy of all files in "/usr/libexec/mc/ext.d"
I commented out all references to "#[ -n "${MC_XDG_OPEN}" ] || MC_XDG_OPEN="xdg-open" at the top in these files then edited each entry that was of interest to me to open the mimetype the way I wanted. For example in doc.sh I want to open epubs as follows:
Code:
    epub)
        ebook-viewer "${MC_EXT_FILENAME}" &
        #mupdf-x11 "${MC_EXT_FILENAME}" &
        ;;
whenever mc gets updated the files in "/usr/libexec/mc/ext.d" are overwritten, but as the last step when I upgrade I
overwrite new ones with mine. This is a quick / dirty solution but was short of time when I was looking for a more
elegant solution and couldn't find one. For me all mimes are handled by apps that I want, since my Slackware is not a standard one - doesn't have kde, xfce, etc. I hope this post helps.
 
Old 05-14-2019, 10:21 AM   #5
ponce
Senior Member
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 4,757

Rep: Reputation: Disabled
there seem to had been a discussion about this matter some time ago, hope it helps

https://www.linuxquestions.org/quest...en-4175639317/
 
Old 05-14-2019, 11:24 AM   #6
perseus12
Member
 
Registered: Oct 2012
Location: here and there
Distribution: Slackware Current, FreeBSD 12.0, LFS 8.4
Posts: 40

Rep: Reputation: Disabled
@ponce
thanks but too late for me :-) I had to figure that out quite a few years ago around 14.0 I think. But it does help me see I'm not the only one having problems with xdg_open, etc. I'm sure that will help many others
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Midnight Commander / Glib yorkshiresteve Linux - Software 3 07-05-2003 05:53 AM
Midnight Commander Colors ocularbob Linux - Software 2 03-31-2003 02:11 PM
Where's mc (Midnight Commander) Shadow Of Death Linux - Software 7 01-09-2003 07:09 PM
RH8, Unicode Font and Term issues with Midnight Commander under remote console Mulefire Linux - Distributions 1 12-28-2002 09:37 AM
Midnight Commander Linux vs FreeBSD Tuzinor Linux - Software 1 03-30-2002 04:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration