On Monday, October 22, 2012 07:23:58 PM lee wrote:
> Frank McCormick <debianl...@videotron.ca> writes:
> > ImageMagicks import commmand seems to work better to select a portion
> > of the page...but it needs a new file name for each shot..which makes
> > it a little awkward.
> > 
> > Does anyone have suggestions...perhaps a batch file to rename the
> > files after they've been taken ?
> 
> ,---- [ ~/.fvwm/.fvwm2rc ]
> 
> | Key Print               A       A       Screenshot
> | 
> | 
> | # Screenshot - using import from ImageMagick
> | # taken from fvwm-crystal
> | 
> | DestroyFunc Screenshot
> | AddToFunc Screenshot
> | + I Exec exec mkdir -p $HOME/fvwm/screenshots
> | + I Exec exec import -window root -quality 100
> | $HOME/fvwm/screenshots/screenshot-`date +%Y%m%d_%H%M`.png
> | 
> | 
> | DestroyFunc Screenshot-Delay
> | AddToFunc Screenshot-Delay
> | + I Exec exec mkdir -p $HOME/fvwm/screenshots
> | + I Exec exec import -pause 10 -window root -quality 100
> | $HOME/fvwm/screenshots/screenshot-`date +%Y%m%d_%H%M`.png
> | 
> | DestroyFunc Screenshot-Frame
> | AddToFunc Screenshot-Frame
> | + I Exec exec mkdir -p $HOME/fvwm/screenshots
> | + I Exec exec import -frame -quality 100
> | $HOME/fvwm/screenshots/screenshot-`date +%Y%m%d_%H%M`.png
> | 
> | 
> | # A little menu...
> | DestroyMenu Screenshot
> | AddToMenu Screenshot
> | + "Screenshot Menu"             Title
> | + "Fullscreen"                  Screenshot
> | + "Delayed fullscreen"          Screenshot-Delay
> | + "Frame"                       Screenshot-Frame
> 
> `----
> 
> 
> You can adjust so you need to select an area, and you can do similar
> with i3 with something like "bindsym $mod+Print exec --no-startup-id
> import ...".

Or, in the traditional UNIX way using pipes and filters, grab a pic of the 
window, then adjust it:
=======
#! /bin/bash

if [ $# -ne 1 ]; then
  echo "Usage: $0 filename"
  echo "where 'filename' is the name of the destination PNG filename; '.png'"
  echo "    will be appended to 'filename'."
  echo
  echo "Run this script, bring the window you want to save to the front,"
  echo "wait for the cursor to change to a big +, and click inside the"
  echo "target window. Then use your favorite image editor to crop and"
  echo "adjust the image as desired."
  exit 1
fi

echo "You have three seconds to bring the target window to the top."
echo "When the cursor changes to a big +, xwd will copy the window you click."

# Wait a few seconds so the target window can be brought to the top
sleep 3

# Now get the sceenshot.
xwd | xwdtopnm | pnmtopng > $1.png
=======

Note that this only works with the visible portion of a window, and is limited 
to the resolution of your display.

Reply via email to