You are not logged in.
I like midnight commander so much, but there's just a couple of things, that kinda bugs me and slow me down a bit...:s
1- How can I run something in the background, (say an flv) by a-highlighting it b-F2 c-@ (do something with it) Now if I type something like 'vlc &' vlc will run both '&' and the flv (in separate vlc instances)
Now I don't want that, I wanna type vlc & and run the highlighted flv in the background. Now I could just type its name in the command line and append it with a &, but what if the file name was too long?
I'm asking this, because if you open something, like an flv in the foreground and try to open something else, it willl compalin that the terminal is busy.
2- When I highlight multiple files (say mp3 or flv) and hit enter to execute them, say with vlc, I'll get an instance for vlc running the first file, when it finishes, I'll get another for the 2nd file, etc.
I don't want that, I just want one instant running all the things I choose to run.
Now I found that to be very inconvinient.
Has anybody found a way around them?
Thanks!
Offline
I managed to get around with mc pretty nicely, hope these will help someone like they did to me.
I managed to write a script for the linking problem @:
http://www.linuxquestions.org/questions … 175453641/
The inconvenient things don't longer exist @:
http://www.linuxquestions.org/questions … 175453289/
Offline
I thought I found an answer here but now I am not sure.
Is it possible to use MC while the executed program is still running? For example I open a doc file in MC but I cannot use it until libreoffice is running. I tried the linked solution (editing extension file) but this did not work for me "vlc is started in its own session so I can continue using MC if I need to." What am I missing?
Offline
You need to background the application:
vlc %f &
Just for the record: The list of commands can be found in /usr/lib/mc/ext.d/*sh files. You may want to modify your local mc.ext file appropriately, otherwise your custom settings will be overwritten during mc's update.
:: Registered Linux User No. 223384
:: github
:: infinality-bundle+fonts: good looking fonts made easy
Offline
Thanks but I still have 2 issues:
1. I do not know exactly why but "command %f &" does not always work, for example" mplayer %f &" does nothing.
2. Anyway, my original goal was to open file from MC otherwise I would simply use the terminal. What do I need to modify in video.sh for example?
#!/bin/sh
# $1 - action
# $2 - type of file
action=$1
filetype=$2
[ -n "${MC_XDG_OPEN}" ] || MC_XDG_OPEN="xdg-open"
do_view_action() {
filetype=$1
case "${filetype}" in
*)
mplayer -identify -vo null -ao null -frames 0 "${MC_EXT_FILENAME}" 2>&1 | \
sed -n 's/^ID_//p'
;;
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)
"${MC_XDG_OPEN}" "${MC_EXT_FILENAME}" 2>/dev/null || \
do_open_action "${filetype}"
;;
*)
;;
esac
Offline
Thanks but I still have 2 issues:
1. I do not know exactly why but "command %f &" does not always work, for example" mplayer %f &" does nothing.
So use it this way instead:
(mplayer %f >/dev/null 2>&1 &)
2. Anyway, my original goal was to open file from MC otherwise I would simply use the terminal. What do I need to modify in video.sh for example?
You shouldn't need to touch this file. Instead, create a rule in your local mc.ext, like this:
shell/i/.avi
Open=(mplayer %f >/dev/null 2>&1 &)
Use a similar entry for other extensions: mp4, rmvb, etc. Of course, remember to remove existing references to video.sh.
Last edited by bohoomil (2013-06-12 15:12:27)
:: Registered Linux User No. 223384
:: github
:: infinality-bundle+fonts: good looking fonts made easy
Offline
Perfect, thanks for your help!
Offline
Even with that code, mplayer is killed if you exit MC. Is there any way to prevent that?
Offline
I can't reproduce that: for me everything is working OK in urxvt and termite, with and without multiplexer (tmux), even when I quit the terminal itself…
:: Registered Linux User No. 223384
:: github
:: infinality-bundle+fonts: good looking fonts made easy
Offline
OK, got it: this doesn't occur with mplayer2 I'm actually using (and forgot to mention -- sorry). For anything else, you may need to use detach:
detach foo
should do the trick.
Last edited by bohoomil (2013-06-13 16:14:45)
:: Registered Linux User No. 223384
:: github
:: infinality-bundle+fonts: good looking fonts made easy
Offline
Thanks for that. Works like a charm. Always wanted to use mc but this issue kept me away.
Offline
(evince %f > /dev/null 2>&1 &)
is the real solution to get rid of annoying stderr output from applications.
Placing "2>&1" before "/dev/null" did not work. Thank you for the tip to place it after.
Offline