1 Replies - 1289 Views - Last Post: 30 May 2008 - 06:36 PM

#1 no2pencil  Icon User is offline

  • Professor Snuggly Pants
  • member icon

Reputation: 6544
  • View blog
  • Posts: 30,651
  • Joined: 10-May 07

Take Screenshots of Xwindows!

Posted 30 May 2008 - 06:06 AM

Description: Save this script in your path. I put mine in /usr/local/bin. Then you can add it your window manager menu.Throw this script into your xwindows menu & at the click of a button you can have a screenshot ready for the next screenshots post!
#!/bin/bash

# Written for Dream In Code 05/30/2008
# By #2pencil

#1st, we check for the most important piece
_path=`which import`
if [ $? -eq 1 ]; then
  echo "import command does not exist, please install it to continue"
  exit
fi
#jump to the temp directory
cd /tmp
#check for & move the last screenshot...
#remember, screenshot2.png gets trashed at this point
if [ -f screenshot1.png ]; then
  mv screenshot1.png screenshot2.png 
fi
# this should always exist
# unless it's the 1st time running...
if [ -f screenshot.png ]; then 
  mv screenshot.png screenshot1.png
fi
# Let it roll!
${_path} -window root screenshot.png


Is This A Good Question/Topic? 0
  • +

Replies To: Take Screenshots of Xwindows!

#2 Ambercroft  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 5
  • View blog
  • Posts: 129
  • Joined: 05-January 07

Re: Take Screenshots of Xwindows!

Posted 30 May 2008 - 06:36 PM

That was the easiest screen shot that I have ever made. Always nice to find bits of code that work without a painful struggle!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1