Screenshot of Alt+Tab in GNOME

Jack Jackson jackson.linux at gmail.com
Sat Aug 20 11:24:11 UTC 2005


I got something from Linux Desktop hacks which lets you store screen 
shots both locally and automatically publish them to a web page; this is 
really useful to show people instantly what you see on your screen. It 
also automatically generates a thumbnail. You can change the delay 
before the snap, the quality, the size of the thumbnail and, if you 
want, have it loop - that is, take a new screenshot every n seconds. You 
install scrot and then make a bash script like this, save it as a perl 
script and execute it with, for example, ./screenshot.pl:

You need perl (you probably have it) and you need the perl  Net::Ftp 
extension.

#!/usr/bin/perl -w
use Net::FTP; #start ftp


#This script puts screenshots directly on a website rather than saving them
#locally. It comes from Desktop Hacks, By Nicholas Petreley, Jono Bacon
#First Edition March 2005, ISBN: 0-596-00911-9 Copyright (c) 2005
# O'Reilly Media, Inc.



#$delay = "5"; #program loop delay in seconds
$delay_snap = "3"; #screen capture delay in seconds
$quality = "75"; #scale of 1-100
$thumb = "25"; #thumbnail size as percentage
$server = "user.com";
$username = "user";
$password = "password";
$serverfolder = "/usr/www/users/yourdir/screenies";
$localfolder = "/home/user/Desktop/screenies";

while()
{
  system("scrot $localfolder/currentscreen.jpg -d $delay_snap --thumb 
$thumb --quality $quality"); #takes the screenshot
  $ftp = Net::FTP->new($server, Debug => 0); #connect
  $ftp->login($username, $password); #log in
  $ftp->binary(); #change to binary transfer mode
  $ftp->cwd($serverfolder); #change to desired server directory
  $ftp->delete("$serverfolder/currentscreen.jpg"); #delete any old 
screenshot
  $ftp->delete("$serverfolder/currentscreen-thumb.jpg"); #delete any old 
screenshot thumbnail
  print "Deleted old screenshot and thumbnail images\n";
  $ftp->put("$localfolder/currentscreen.jpg"); #uploading image
  $ftp->put("$localfolder/currentscreen-thumb.jpg"); #uploading thumbnail
  print "Completing upload\n";
  $ftp->quit; #close ftp session
  print "Done. Quitting. Later, dude.\n";
  exit;
}






Magnus Therning wrote:
> On Fri, Aug 19, 2005 at 02:55:30PM -0400, Stephen R Laniel wrote:
> 
>>I'd like to be able to show some people what happens under
>>GNOME when you hit Alt+Tab. So I want to hit Alt+Tab to
>>bring up the task switcher, then press PrtSc to take a
>>screenshot. But this seems impossible: GNOME thinks I'm
>>pressing Alt+Tab+PrtSc, which isn't mapped to an action, and
>>it just closes the task switcher without taking a
>>screenshot.
>>
>>Does anyone know how to do what I want to do?
> 
> 
> I've seen some people proposing using KSnapshot or Gimp. You can also
> use the gnome-panel-screenshot, you have to do it from the command line
> though. Clicking Help in the dialogue presented after taking a snapshot
> reveals that
> 
>  gnome-panel-screenshot --delay=<seconds>
> 
> Will do what you want.
> 
> It's also possible to use 'import' from imagemagick:
> 
>  import -window root -pause <seconds> <file>
> 
> /M
> 
> 




More information about the ubuntu-users mailing list