I was searching for a commandline tool for capturing screen shot in Linux, and ended up using very nice tool called import (An utility from imagemagic). import is a command line tool, where we can use it for taking screenshot, image manipulation, filtering etc.
In arch Linux you can install imagemagic using command:
$ sudo pacman -S imagemagick
Let me tell you 2 usefull commands of import.
$ import region.jpg
This command will give you mouse prompt to select region in the window to capture. By selecting the region, file with the name region.jpg gets created.
$ sleep 2; import -window root /tmp/MyScreenshot.png
This command sleeps for 2 seconds before capturing the entire screen. The complete screen will get stored in file MyScreenshot.png. The sleep time user can give anything which is necessary.
I haven’t found options to take screenshot along with mouse pointer in import command. There is one more tool called gnome-screenshot, can be used to capture screenshot with mouse pointer.
Installing gnome-screenshot in Arch Linux:
sudo pacman -S gnome-screenshot
Example command to capture screenshot along with mouse pointer using gnome-screenshot:
gnome-screenshot -p -f /tmp/image.png
Here, option -p is for including mouse pointer, without this option it will ignore the mouse pointer. -f option is for filename to save the screenshot.