Scrot is a simple but quite powerful command line screenshot tool. I have been using it now sometime already and it is a lot more versatile than for example gnome-screenshot. I wanted to make it little easier to use for me and decided to add my most used commands in Openbox menu. Of course first thing is to install Scrot. If you are using Ubuntu, just install it thru Synaptic Package Manager or type in terminal:

sudo aptitude install scrot

Adding the Scrot in Openbox menu

If you are new to Openbox, I recommend reading for example these:

* menu tutorial
* Openbox guide – urukrama’s weblog (especially “4. Configuring Openbox”)

So open the menu.xml -file (~/.config/openbox/menu.xml) in your favourite editor (for example gedit or Leafpad). Dot in front of config means it’s hidden, so you have to enable showing hidden folders/files if you look for it in your file browser (ctrl+h). Or you could type in terminal:

leafpad ~/.config/openbox/menu.xml

From my menu.xml -file:

<menu id="scrot" label="Scrot">
	<item label="Scrot (PrtSc)">
		<action name="Execute">
			<execute>
				scrot -e 'mv $f ~/images/screenshots/'
			</execute>
		</action>
	</item>
	<item label="delay 15">
		<action name="Execute">
			<execute>
				scrot -d 15 -e 'mv $f ~/images/screenshots/'
			</execute>
		</action>
	</item>
	<item label="Scrot area (Alt-PrtSc)">
		<action name="Execute">
			<execute>
				scrot -s -e 'mv $f ~/images/screenshots/'
			</execute>
		</action>
	</item>
</menu>

The first option takes screenshot immediately, second one has 15 seconds delay and with third one you can select the area (using the mouse) of the screen.

I have also set keybinding for each alternative (more about keybindings). This you can do by editing rc.xml -file (~/.config/openbox/rc.xml).

<keybind key="Print">
      <action name="Execute">
        <execute>scrot -e 'mv $f ~/images/screenshots/'</execute>
      </action>
    </keybind>
    <keybind key="A-Print">
      <action name="Execute">
        <execute>scrot -s -e 'mv $f ~/images/screenshots/'</execute>
      </action>
    </keybind>
    <keybind key="C-Print">
      <action name="Execute">
        <execute>scrot -d 15 -e 'mv $f ~/images/screenshots/'</execute>
      </action>
</keybind>

More about scrot options in scrot man page (you can access in man also by typing in terminal man scrot).