This version of the page http://www.rationalplanet.com/?p=2291 (0.0.0.0) stored by archive.org.ua. It represents a snapshot of the page as of 2012-03-21. The original page over time could change.
How to Make Screenshots in Linux Really Quickly | LAMP Freelancer

Articles Comments Mobile Version

LAMP Freelancer » How-Toes, Linux, Linux Desktop » The Quickest Self-Brewed Screen Grabber for Linux

The Quickest Self-Brewed Screen Grabber for Linux

Sometimes you need to make a series of screenshots very quickly, and you have no time to think about output file names and the rest of the things. However, in Linux you can do this only typing one letter and clicking a mouse button.

First we check if the software we need exists:

import --version

If you see this:

Version: ImageMagick 6.6.4-1 2010-12-17 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2010 ImageMagick Studio LLC
Features: OpenMP

it means no other steps necessary, otherise install ImageMagick with:

sudo yum -y install ImageMagick

After the software in installed, create the bash script you will use:

mkdir -p ~/bin
touch ~/bin/g
chmod a+x ~/bin/g
gedit ~/bin/g

Copy, paste and save:

#!/bin/bash
DIR=`pwd`
NUM=`ls -1 | wc -l`
FILL=`printf "%04d" $NUM`
import "$DIR/$FILL.png"

Add “bin” directory to your path so that it works from any directory (if not done before):

echo 'PATH="$PATH:$HOME/bin"' >> ~/.bash_profile

Now you have log out and log in back so that the changes take place.

Create an empty directory for your screenshots:

mkdir test
cd test

Using the whole thing is just typing in console (I love yakuake, it retracts with F12 and the desktop is all yours) like:

g

hit ENTER (watch the cursor turning into a cross) and click any window.

The script will create a file which name will be [NUMBER OF FILES+DIRS IN A DIRECTORY + 1].png, namely “0001.png” for an empty folder.

If you repeat the operation, the next file name will be “0002.png” and so on.

In 2 minutes you will learn how to make a screenshot within a part of a second without thinking of file names and the other stuff.

Enjoy!

(You can also design a key binding for that but this is a completely different story.)

Related posts:

  1. Get Codec and/or Stream Information of Media Files in Linux
  2. [Solved] Fast High Quality Encoding of ape Format into Lame mp3 or Nero m4a on Linux
  3. Add More Swap Space to Linux
  4. Change Fedora 9 Login Screen to KDM (GDM does not login)
  5. True type fonts in Linux

Written by Alec

Visit Alec's Website

Follow Alec on Twitter

Filed under: How-Toes, Linux, Linux Desktop · Tags: command line, fast, file, how-to, ImageMagick, Linux, png, quick, screenshot, script, snapshot

Support this site:

Leave a Reply Cancel reply

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>