Screenshots

Screenshots #

This describes how you can take screenshots while using the cwm window manager.

First, install maim and xclip, so pkg_add maim xclip.

Then, create the file ~/bin/screenshot with this content:

#!/bin/sh

maim -s | xclip -selection clipboard -t image/png

Make it executable (chmod +x).

To make it easy to screenshot, add a keybinding in your .cwmrc, like this:

bind-key 4-F11          "bin/screenshot"

After reloading cwm you can now screenshot by pressing Win+F11, or whatever key you chose. Unfortunately the PrtScr key can’t be reliably bound, so it’s better to pick another key.

Screenshots created using this method are stored to clipboard. You can paste them to GIMP for example. You can also save them to file using xclip.

Add this to your .kshrc:

alias clip2file='xclip -selection clipboard -o >'

You can now type in the shell something like clip2file screenshot.png to save the clipboard content to a file.