From shell script to compact tool
|
Sometimes you need things fast; when the search for a needed tool leads to a dead end, a knowledgeable Linux user can usually cobble together a program with a few lines of shell code. However, putting a bit more time into the quickly developed script could result in a robust program.
One example is the famous Windows "Snipping Tool" that captures sections of a screen and opens, saves, or copies them to the clipboard for use in another program. The same function is easily programmed in Linux. With a bit of effort, you can create a full-fledged tool that you can integrate into your desktop as a keyboard shortcut or as an item in the start menu or taskbar.
Roll Your Own
The basis for the present project is the import tool [1] from the powerful ImageMagick [2] command-line graphics suite. The introduction on its man page is enough to give you an idea of its capabilities: It captures a single window, the whole screen, or any rectangular portion thereof and saves it as a graphics file or sends it to standard output, from which you can pipe it to another command.
[...]
Buy this article as PDF
Pages: 4
(incl. VAT)