Hide the terminal during execution of shell script
I made a script (.sh) that lists all files in a folder in the format and use any such software to open the file and display it. Everything works well.
But then, I think it's ugly to see the execution of certain orders for videos. For example, when my script arrived on a video, here's what it shows (for information, I use mplayer to view the videos):
MPlayer 1.0rc2-4.2.3 (C) 2000-2007 MPlayer Team
CPU: Intel (R) Pentium (R) 4 CPU 2.66GHz (Family: 15, Model: 2, Stepping: 9)
CPUflags: MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.
Playing Saathiya.mov.
ISO: File Type Major Brand: Original QuickTime
Quicktime / MOV file format detected.
[mov] Video stream found,-vid 0
[mov] Audio stream found,-aid 1
VIDEO: [avc1] 400x300 24bpp 25,000 fps 0.0 kbps (0.0 kbyte / s)
xscreensaver_disable: Could not find xscreensaver window.
GNOME screensaver disabled
================================================== ========================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
================================================== ========================
================================================== ========================
Forced audio codec: mad
Opening audio decoder: [faad] AAC (MPEG2 / 4 Advanced Audio Coding)
AUDIO: 44100 Hz, 2 ch, s16le, 32.0 kbit/2.27% (ratio: 4000 -> 176400)
Selected audio codec: [faad] afm: faad (FAAD AAC (MPEG-2/MPEG-4 Audio) decoder)
================================================== ========================
AO: [pulse] 44100Hz 2ch s16le (2 bytes per sample)
Starting playback ...
Due: in config request - 400 x 300 (preferred colorspace: Planar YV12)
Due: using Planar YV12 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
VO: [xv] 400x300 => 400x300 Planar YV12
GNOME screensaver enabled.000 ct: 0,046 64 / 64 14% 1% 1.5% 5 0
Exiting ... (Quit)
So what would be cool, it would be to succeed in hiding the terminal during the execution of shell script and once it has finished all the files go hop on redisplays the terminal. Is this possible?
Or, can we create a window with black background, for example, which covers the entire screen and displays the images and videos (I mean that would not at all the terminal)?
Re: Hide the terminal during execution of shell script
During the execution, mplayer written on stdout (standard output) and stderr (the dedicated output for errors).
It is possible to redirect the output to other things ... /dev/null for example (it returns all messages to the nil).
To do this:
Code:
mplayer [options] name_of_the_video> /dev/null 2>&1
With that, the console is still displayed, but it "speaks" it. It responds to your problem?
Re: Hide the terminal during execution of shell script
I just tested your solution at the moment. The video was launched without displaying all the lines in the terminal configuration. It solves one of my many problems.
So thank you for your help.
Another small issue, I was told about X Server, I did research on the internet but I have not found much that clearly. So if you have any knowledge about it, it would be great to know.
Re: Hide the terminal during execution of shell script
In fact, the X server is ... a server. It "communicates" with the screen, mouse, keyboard ...
Above, we run a X client that connects to that server and sends requests to display.
This system makes the X client can be on another machine as the X server (to convince worry, you can try the option of SSH-X).