1

I'd like to start a new GUI (say in tty8) from tty1 with the command

mplayer -fs /tmp/movie.mp4

How to start a new GUI with this custom command from tty1?

The command

xinit  /usr/bin/mplayer -fs /usr/local/movie.mp4 $* -- :1

lead to a black screen instead of the movie.

2

mplayer wants to read from standard input (you can use keyboard shortcuts in the terminal as well as in the mplayer window) and to display messages on standard output. When you run it directly from xinit, its standard input and standard output are connected to the same terminal that you ran xinit from. Since mplayer isn't the foreground process on that terminal, it can't access the terminal: it gets suspended with a SIGTTOU.

A workaround is to redirect standard input from /dev/null. (Redirecting stdout and stderr doesn't work, mplayer still gets suspended with SIGTTOU, I don't know why.)

xinit /bin/sh -c 'exec "$0" "$@" </dev/null" mplayer -fs /usr/local/movie.mp4 "$@" -- :1
  • Thanks. That is perfect. If no new GUI is needed: mplayer -vo fbdev2 /dev/fb0 movie.mp4 –  j1088099.mvrht.com. Dec 11 '16 at 0:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.