Results 1 to 4 of 4

Thread: Hide the terminal during execution of shell script

  1. #1
    Join Date
    Nov 2008
    Posts
    1,054

    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)?

  2. #2
    Join Date
    May 2008
    Posts
    1,304

    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?

  3. #3
    Join Date
    Nov 2008
    Posts
    1,054

    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.

  4. #4
    Join Date
    May 2008
    Posts
    1,304

    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).

Similar Threads

  1. Shell terminal for Mac OS X
    By Jensen Ackles in forum Customize Desktop
    Replies: 6
    Last Post: 05-05-2010, 10:23 AM
  2. Shell script with sed
    By Ameeryan in forum Software Development
    Replies: 5
    Last Post: 23-12-2009, 02:29 PM
  3. Script execution machine available by mail
    By HardWeaR in forum Software Development
    Replies: 3
    Last Post: 11-12-2009, 02:01 PM
  4. Stop the execution of a script
    By leon m in forum Technology & Internet
    Replies: 3
    Last Post: 26-01-2009, 06:53 PM
  5. Replies: 2
    Last Post: 29-03-2007, 06:29 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,727,423,994.26398 seconds with 17 queries