[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.

Welcome to the Slackware Documentation Project

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
howtos:window_managers:take_a_screenshot [2013/02/09 16:55 (UTC)] – [How To Take a Screenshot ?] hazelhowtos:window_managers:take_a_screenshot [2013/02/09 17:11 (UTC)] – [Imagemagick's ''import'' Command] hazel
Line 9: Line 9:
  
 ===== Using the Import Function of an Application ===== ===== Using the Import Function of an Application =====
-I will explain here how to do it with ''xpaint'', a pretty light software that has the basic tools you would need to work on a screenshot. You may not need all the power of The GIMP to do some basic changes to a screenshot. Plus it's already installed in a default Slackware install.+I will explain here how to do it with ''xpaint'', a pretty lightweight piece of software that has the basic tools you would need to work on a screenshot. You do not need all the power of The GIMP to make some basic changes to a screenshot. Plus it's already included in a default Slackware install.
  
-Open ''xpaint'' from an xterm, or from your DE / WM menu. Open the "Canvas" menu and select "Take snapshot". A little edge appears, this will allow you to select the application window you are capturing. Then, it depends which mouse button you click on.+Open ''xpaint'' from an xterm, or from your DE / WM menu. Open the "Canvas" menu and select "Take snapshot". A little edge appears, which will allow you to select the application window you are capturing. What happens next depends which mouse button you click on.
   * To capture the whole screen, left-click or middle-click somewhere on your desktop. To be precise, on a part of the desktop where you can see the desktop's background or background image.   * To capture the whole screen, left-click or middle-click somewhere on your desktop. To be precise, on a part of the desktop where you can see the desktop's background or background image.
   * To capture a specific window, left-click or middle-click somewhere in it.   * To capture a specific window, left-click or middle-click somewhere in it.
Line 21: Line 21:
 ===== The Keyboard Method ===== ===== The Keyboard Method =====
 Press the <key>PrtScr</key> key, located usually on the top-right of your keyboard. It can also read <key>PrnScr</key>, <key>Print Screen</key>, etc. Open an image editing program (GIMP, xpaint, ...), and choose the paste option, usually the <key>Ctrl+V</key> combo. On some systems, it has been reported that using <key>Alt+PrtScr</key> solves the problem. Press the <key>PrtScr</key> key, located usually on the top-right of your keyboard. It can also read <key>PrnScr</key>, <key>Print Screen</key>, etc. Open an image editing program (GIMP, xpaint, ...), and choose the paste option, usually the <key>Ctrl+V</key> combo. On some systems, it has been reported that using <key>Alt+PrtScr</key> solves the problem.
-<note>Neither of the methods are working on my system, and as I don't know yet if it's because of my hardware/laptop configuration or because of my X keyboard setup, I can't guarantee that it will work on your system. Neither can I tell you if it's supposed to work on a tty. The article will eventually show the hint as I find out or someone else posts some suggestion(s).\\ </note>+<note>Neither of these methods works on my systemI don't know yet if it's because of my hardware/laptop configuration or because of my X keyboard setup, so I can't guarantee that it will work on your system. Neither can I tell you if it's supposed to work on a tty. The article will eventually show the hint as I find out or someone else posts some suggestion(s).\\ </note>
  
 ===== The Command-Line Way ===== ===== The Command-Line Way =====
Line 34: Line 34:
 <code>xwd | convert - path/to/screenshot.ext</code> <code>xwd | convert - path/to/screenshot.ext</code>
  
-You will be provided with a crosshair, just select the window you want to capture. You can change the type of the output file only by changing the extension, for example ''screenshot.png'', ''screenshot.jpg'', ''screenshot.gif'', etc. The ''-'' switch is to indicate ''convert'' that you are using the standart input. +You will be provided with a crosshair, just select the window you want to capture. You can change the type of the output file only by changing the extension, for example ''screenshot.png'', ''screenshot.jpg'', ''screenshot.gif'', etc. The ''-'' switch is to indicate to ''convert'' that it should translate from standard input rather than a file
-<note tip>Remember to bring the window you want to grab on top of the others. Every window which covers it will be replaced by black pixels (or black boxes) in the final capture. Which by the way can be an useful way to hide some parts of the output! For example if you take a screenshot of an xterm full of commands with some of your personal info displayed (passwords, IP addresses, ...), or a screenshot of a browser and you want to hide some tabs. Just place some windows over the one you want to capture.</note>+<note tip>Remember to raise the window you want to grab above the others. Otherwise every window which covers it will be replaced by black pixels (or black boxes) in the final capture. Which by the way can be an useful way to hide some parts of the output! For example if you take a screenshot of an xterm full of commands with some of your personal info displayed (passwords, IP addresses, ...), or a screenshot of a browser and you want to hide some tabs. Just place some windows over the one you want to capture.</note>
  
 If you want to capture a window WITH its overlayered windows, so that the capture does not display a black box but instead the overlaying window(s) content (for example, an application menu or an xterm window over a browser to capture both at the same time, etc), use the ''-screen'' switch: If you want to capture a window WITH its overlayered windows, so that the capture does not display a black box but instead the overlaying window(s) content (for example, an application menu or an xterm window over a browser to capture both at the same time, etc), use the ''-screen'' switch:
Line 43: Line 43:
 Add the ''-root'' switch to get: Add the ''-root'' switch to get:
 <code>''xwd -root | convert - path/to/screenshot.ext''</code> <code>''xwd -root | convert - path/to/screenshot.ext''</code>
-The ''-root'' indicates you want to grab the "main" X window, so all what you can see currently displayed on screen (//root// is the name of the main X window). As it's capturing the whole screen, you wont need to select a window.\\ +The ''-root'' indicates you want to grab the "main" X window, so all what you can see currently displayed on screen (//root// is the name of the main X window). As it's capturing the whole screen, you won'need to select a window.\\ 
  
 ==== Imagemagick's ''import'' Command ==== ==== Imagemagick's ''import'' Command ====
  
-<note warning>There may be a bug or at least a glitch on some systems, as ''import -screen'' and ''import -window root'' may show "black boxes" overlaying the window that has been captured, which indicates that some other window(s) are getting on top of it before the capture takes place, even if you don't see it(them)!\\  +<note warning>There may be a bug or at least a glitch on some systems, as ''import -screen'' and ''import -window root'' may show "black boxes" overlaying the window that has been captured, which indicates that some other window(s) are getting on top of it before the capture takes place, even if you don't see it/them!\\  
-I don't know what causes this behaviour, nor have found or really searched for an explanation yet. Nonetheless, it seems that the ''-frame'' switch works better, but it has the same limitations as ''-screen'' (you can't get overlaying windows content). You can also try to minimize all open windows.\\ If it doesn't help, use ''xwd'' for correct captures, or grab your hitchhiking guide and get on google.</note>+I don't know what causes this behaviour, nor have found or really searched for an explanation yet. Nonetheless, it seems that the ''-frame'' switch works better, but it has the same limitations as ''-screen'' (you can't get overlaying windows content). You can also try to minimize all open windows.\\ If that doesn't help, use ''xwd'' for correct captures, or grab your hitchhiking guide and get on google.</note>
  
-The ''import'' command is part of the ImageMagick suite of tools. It works as ''xwd'' but doesn't need the ''convert'' program and use different options (switches).+The ''import'' command is part of the ImageMagick suite of tools. It works like ''xwd'' but doesn't need the ''convert'' program and uses different options (switches).
  
 === Capturing a window === === Capturing a window ===
Line 65: Line 65:
 or or
 import -frame path/to/screenshot.ext</code> import -frame path/to/screenshot.ext</code>
-The ''-window root'' is equivalent to ''xwd'''s ''-root'' switch. It captures the whole desktop. The ''-frame'' option can be used to prevent black boxes as per the warning.+The ''-window root'' is equivalent to ''xwd'''s ''-root'' switch. It captures the whole desktop. The ''-frame'' option can be used to prevent black boxes as in the warning above.
  
 ==== Hints for Fullscreen Applications ==== ==== Hints for Fullscreen Applications ====
 howtos:window_managers:take_a_screenshot ()