View previous topic :: View next topic |
Author |
Message |
alex.blackbit Advocate
Joined: 26 Jul 2005 Posts: 2397
|
Posted: Fri Nov 16, 2012 6:37 pm Post subject: midnight commander - file associations [SOLVED] |
|
|
Hi,
my mc opens video files with vlc now, I don't know why.
I looked inside the /etc/mc/mc.ext file and found this:
Code: | ---8<---
### Video ###
shell/i/.avi
Include=video
regex/i/\.as[fx]$
Include=video
shell/i/.divx
Include=video
shell/i/.mkv
Include=video
regex/i/\.(mov|qt)$
Include=video
regex/i/\.(mp4|m4v|mpe?g)$
Include=video
# MPEG-2 TS container + H.264 codec
shell/i/.mts
Include=video
shell/i/.ts
Include=video
shell/i/.vob
Include=video
shell/i/.wmv
Include=video
regex/i/\.fl[icv]$
Include=video
shell/i/.ogv
Include=video
regex/i/\.ra?m$
Open=/usr/libexec/mc/ext.d/video.sh open ram
# WebM
shell/i/.webm
Include=video
type/WebM
Include=video
include/video
Open=/usr/libexec/mc/ext.d/video.sh open ALL_FORMATS
View=%view{ascii} /usr/libexec/mc/ext.d/video.sh view ALL_FORMATS
---8<--- |
I do not have an ~/.config/mc/mc.ext file.
The content of /usr/libexec/mc/ext.d/video.sh is: Code: | #!/bin/sh
# $1 - action
# $2 - type of file
action=$1
filetype=$2
do_view_action() {
filetype=$1
case "${filetype}" in
*)
cat "${MC_EXT_FILENAME}"
;;
esac
}
do_open_action() {
filetype=$1
case "${filetype}" in
ram)
(realplay "${MC_EXT_FILENAME}" >/dev/null 2>&1 &)
;;
*)
if [ -n "$DISPLAY" ]; then
(mplayer "${MC_EXT_FILENAME}" >/dev/null 2>&1 &)
else
mplayer -vo null "${MC_EXT_FILENAME}"
fi
#(gtv "${MC_EXT_FILENAME}" >/dev/null 2>&1 &)
#(xanim "${MC_EXT_FILENAME}" >/dev/null 2>&1 &)
;;
esac
}
case "${action}" in
view)
do_view_action "${filetype}"
;;
open)
xdg-open "${MC_EXT_FILENAME}" 2>/dev/null || \
do_open_action "${filetype}"
;;
*)
;;
esac |
My assumption would be that video files should be opened with mplayer. I do not see vlc anywhere.
Code: | $ (find $HOME/.config/mc -type f; qlist -e mc) | xargs sudo grep vlc
/usr/share/mc/syntax/sh.syntax: keyword whole svlc cyan
/usr/share/mc/syntax/sh.syntax: keyword whole vlc cyan
/usr/share/mc/syntax/sh.syntax: keyword whole wxvlc cyan
/usr/share/mc/syntax/sh.syntax: keyword whole svlc cyan
/usr/share/mc/syntax/sh.syntax: keyword whole vlc cyan
/usr/share/mc/syntax/sh.syntax: keyword whole wxvlc cyan |
I am open to all ideas.
Thanks in advance.
Last edited by alex.blackbit on Sat Nov 17, 2012 8:35 am; edited 1 time in total |
|
Back to top |
|
|
paulbiz Guru
Joined: 01 Feb 2004 Posts: 508 Location: St. Louis, Missouri, USA
|
Posted: Fri Nov 16, 2012 8:34 pm Post subject: |
|
|
I believe it is using xdg-open which will play the video using the default player according to the MIME type associations on your system. |
|
Back to top |
|
|
alex.blackbit Advocate
Joined: 26 Jul 2005 Posts: 2397
|
Posted: Sat Nov 17, 2012 8:34 am Post subject: |
|
|
Right, I overlooked that.
Thank you, paulbiz.
It seems like the directory of interest is $HOME/.local/share/applications, especially the file mimeapps.list.
I modified the file I had to end up with this content:
Code: | [Added Associations]
[Default Applications]
application/x-cd-image=brasero-open-image.desktop;nautilus-cd-burner-open-iso.desktop;file-roller.desktop;userapp-totem-EZHRWU.desktop;userapp-mplayer-FJ43VU.desktop;
application/x-linguist=userapp-mplayer-ER1P0U.desktop;
application/octet-stream=gedit.desktop;
inode/directory=nautilus-folder-handler.desktop;brasero-copy-medium.desktop;
application/rdf+xml=gedit.desktop;
audio/x-vorbis+ogg=userapp-mplayer-RRK3UU.desktop
video/mp4=userapp-mplayer-RRK3UU.desktop
video/quicktime=userapp-mplayer-RRK3UU.desktop
video/x-ogm+ogg=userapp-mplayer-RRK3UU.desktop
video/x-msvideo=userapp-mplayer-RRK3UU.desktop
video/x-flv=userapp-mplayer-RRK3UU.desktop
video/x-ms-wmv=userapp-mplayer-RRK3UU.desktop;
video/x-matroska=userapp-mplayer-RRK3UU.desktop;
video/mpeg=userapp-mplayer-RRK3UU.desktop;
video/x-ms-asf=userapp-mplayer-RRK3UU.desktop;
video/mp4=userapp-mplayer-RRK3UU.desktop; |
I achieved what I wanted, video files are opened with mplayer.
Thanks again paulbiz. |
|
Back to top |
|
|
|