#!/usr/bin/perl # # Use sgi's mediarecorder to grab a signa console screen. # # Usage: # 1. launch this script from a command window: type "lxgrab". # 2. there will be a 2 second delay allowing you to switch to the screen # that you wish to capture. # 3. the mediarecorder gui will pop-up # 4. hit the red record button # 5. there will be a 2 second delay before the screen is captured allowing # you to "iconify" the gui window by clicking the LEFT of the 2 # window manager buttons in the upper-right-hand corner of the gui's # window. during this time, you may faintly see the dashed outline # of the captured region around the perimeter of the screen. # 6. the name of the file that was generated is echoed back in the # command window where the script was started. # # DB Clayton - 2003 Jun 25, 2003 Sep 23 #- # output file name parts $dir = '/usr/g/mrraw/'; # dir where rgb files will be saved $base = 'screen'; # first part of file name $ext = '.tif'; # file name extension # get the next sequential file name $i = 0; $rgb = $dir.$base.sprintf("%02d", $i).$ext; while (-f $rgb) { if ($i > 99) {die "the number of output files in $dir has exceeded 100.\n";} $rgb = $dir.$base.sprintf("%02d", $i++).$ext; } # launch recorder sleep 2; # wait 2 seconds while the user switches to the screen to be grabbed @out = `/usr/sbin/mediarecorder -media image -source screen -imageoptions format=tiff -outputfile $rgb -exitdone -screensel x=1,y=1,h=1040,w=1280 -delay 2 2>&1`; print "screen saved in file: $rgb\n";