Feature #545
Using Obkey To Add Screenshot Hot Key To LXDE on Arch
Description
Taking screenshots is one of the functions every desktop computer must have; for troubleshooting, taking game screenshots, or even taking a snapshot of a web blog post before a moderator pulls it. I use Arch with LXDE for my main work desktop, and it lacks a print screen hot key function natively. This is how I added is to my desktop.
- Ensure ImageMagick is installed
sudo pacman -S ImageMagick
- Install yaourt
- Install obkey from the AUR using yaourt:
yaourt obkey
- Open the LXDE config with obkey:
obkey ~/.config/openbox/lxde-rc.xml
- Then Insert a New Sibling Keybind
- Select the newly created key, it will prompt New Accelerator...
- Press the key combination to the screenshot, in my case it was Fn + F11
- Associate the new key combo with an action, by going to the action pane and clicking Insert Action -> Execute
- In the command text box add the following:
sh -c "import -window root ~/Pictures/$(date '+%Y%m%d-%H%M%S').png"
- Click on the Save icon and exit.
Now when the screenshot icon is pressed a timestamped PNG of the current active windows will be saved in the Pictures directory in the home folder.