You are not logged in.
Hello everybody,
I cannot open pdf, html files in midnight commander with preferred applications (zathura, luakit). Exceptions are media files which open fine with mpv and doc files which open fine with openoffice.
I tried
export MC_XDG_OPEN=/usr/local/bin/nohup-openOpen=zathura %f Open=(zathura %f >/dev/null 2>&1 &)Same for luakit.
Still if I type in the command line
zathura name.pdfor
lesspipe.sh name.pdfthe file opens.
I also edited
/.config/mimeapps.list /usr/share/applications/mimeinfo.cachexdg-mime query default application/pdf
org.pwmt.zathura.desktopxdg-settings get default-web-browser
luakit.desktopDid not help.
Pdf files will not open when pressing ENTER.
With html files when I press ENTER it opens the file with geany. Why?!
Any help is highly appreciated!
Thank you in advance!
Last edited by amaro (2020-12-23 21:17:34)
Offline
Open=zathura %f Which mc.ext did you edit and do you have anoteher one in ~/.config/mc/mc.ext?
Online
Put the following in your mimeapps.list?
application/pdf=zathura.desktop
edit:
The reason I pointed to mimeapps is you'll find out why 'html' files are opening in Geanny too.
BTW, I find using 'Open=(mupdf %f)' not very convenient for it occupies MC completely.
So, you could at least consider 'Open=(mupdf %f &)' which I still find a sloppy solution, but that's up to you;)
Also consider edit config files local and not system-wide.
Last edited by qinohe (2020-12-22 23:20:57)
Offline
@qinohe
I tried 'Open=(mupdf %f &)' and putting 'mupdf.desktop' in the 'mimeapps.list'. Neither worked. Same with 'zathura'.
@seth
I edit the file from Command -> Edit extension file
Editing the file in ~/.config/mc/mc.ext didn't help either.
Last edited by amaro (2020-12-23 11:32:55)
Offline
Should that not be something like
# Open PDF-files in external viewer.
type/^PDF
Open=(yourviewer %f &)
View=%view{ascii} pdftotext %f -
# html
regex/i/\.html?$
Open= (yourbrowser %f &)in your mc.ext ?
Last edited by Archlin (2020-12-23 12:54:11)
Offline
It seems the problem is elsewhere.
I ran
$ which mc
/usr/local/bin/mcI did
# mv /usr/local/bin/mc /usr/local/bin/mc.bak
renamed '/usr/local/bin/mc' -> '/usr/local/bin/mc.bak'I reinstalled 'mc'.
Then
$ mc
bash: /usr/local/bin/mc: No such file or directoryI tried
$ /usr/bin/mcand everything works fine.
So, how to make 'mc' to execute '/usr/bin/mc' and not 'usr/local/bin/mc'?
BTW, I have no idea how this occured in the first place.
Last edited by amaro (2020-12-23 12:51:03)
Offline
Have /usr/bin above /usr/local/bin in $PATH, but that's not "correct", or alias mc to /usr/bin/mc but that's nonsense.
You simply should not have some random mc binary in /usr/local/bin - where does it come from, which "mc --version" is that?
Online
Well, there is a difference
$ /usr/bin/mc --version
GNU Midnight Commander 4.8.25
Built with GLib 2.66.1
Built with S-Lang 2.3.2 with terminfo database
With builtin Editor
With subshell support as default
With support for background operations
With mouse support on xterm and Linux console
With support for X11 events
With internationalization support
With multiple codepages support
With ext2fs attributes support
Virtual File Systems:
cpiofs, tarfs, sfs, extfs, ftpfs, sftpfs, fish, smbfs
Data types:
char: 8; int: 32; long: 64; void *: 64; size_t: 64; off_t: 64;$ /usr/local/bin/mc --version
GNU Midnight Commander 4.8.7
Built with GLib 2.60.3
Using the S-Lang library with terminfo database
With builtin Editor
With subshell support as default
With support for background operations
With mouse support on xterm and Linux console
With support for X11 events
With internationalization support
With multiple codepages support
Virtual File Systems: cpiofs, tarfs, sfs, extfs, ftpfs, sftpfs, fish
Data types: char: 8; int: 32; long: 64; void *: 64; size_t: 64; off_t: 64;I can't even uninstall it
# Rns mc
checking dependencies...
Package (1) Old Version Net Change
mc 4.8.25-3 -7.05 MiB
Total Removed Size: 7.05 MiB
:: Do you want to remove these packages? [Y/n] How to get rid of it?
Offline
You seem to work carelessly, anyway what error message do you get when removing MC.
Also paste full commands not parts of it, like 'Rns mc' I know you mean 'pacman -Rsn' but WTF.
If you'd be using '~/.config' dir to store local MC config instead of editing global configs you'll be creating a much less error-prone environment.
Why is MC in '/usr/local/bin' in the first place? reason?
@Archlin. yes, but I suppose people using Arch read man pages, wiki's or other articles to gather their info and know what you mean if info is posted, it looks like OP 'knows' what he/she's doing (looking at #1) and so who am I to play the teacher here. Also it wouldn't be my place because every Archer is a seasoned Linux-er already when he/she jumps this boat
Offline
pacman -Qo /usr/local/bin/mc if it's from some AUR .
Otherwise "uninstallation" is going to be some hassle, basically look up the mc package and then look for everything it puts into /usr in /usr/local. Ensure the files aren't owned by some other package and remove them.
Typically a /usr/local installation if from you running "configure; make; sudo make install" on the mc sources … about 8 years ago…
Online
@seth, I would have wished to hear that from OP, guess we are in need of a spoiler button ![]()
Offline
Here is the solution I have found:
When I saw that the mc version is 4.8.7 I checked the /var/cache/pacman/pkg folder for it. There was not one.
Then I checked my drive for such package. Luckily there was a folder named mc-4.8.7. There was not such package either. But all the installation files were there.
The I googled How to uninstall app from /usr/local/bin.
Found old arch thread here https://bbs.archlinux.org/viewtopic.php?id=92329
So I did cd to mc-4.8.7 folder.
Then ran
./configure
make
make uninstallThen checked with
which mcIt was gone.
Rebooted.
Now everything is fine.
p.s. Lesson learned.
p.p.s. Thank you qinohe and seth!
Offline