In Kubuntu (14.04) the PrintScreen key opens KSnapshot, a graphical program for choosing how to save the screenshot. When taking lots of screenshots it is more convenient for screenshots to save automatically to a timestamped file. How do I do this?
1 Answers
PrintScreen From Terminal
From the terminal we can produce the screenshots we want with the ImageMagik import command. To save a time-stamped full-screen screenshot to your pictures folder run:
import -window root ~/Pictures/screenshot$(date +"%Y-%m-%d_%H:%M:%S").png
To save a time-stamped screenshot of the current window to your pictures folder run:
import -window $(xdotool getwindowfocus) ~/Pictures/screenshot$(date +"%Y-%m-%d_%H:%M:%S").png
(This may require you to install xdotool with sudo apt-get install xdotool if it is not already installed.)
Setting up the hotkeys
If this commands work then you can assign the hotkeys by opening system settings and selecting "Shortcuts and Gestures"

Select "Custom Shortcuts". At the bottom of the list select "Edit">"New">"Global Shortcut">"Command/URL". Rename the shortcut and select the "Trigger" tab. Click The button labelled "None" and then press the PrintScreen key. This will warn you you are reassigning this away from PrintScreen, click "reassign".

Now select the "Action" tab and enter import -window root ~/Pictures/screenshot$(date +"%Y-%m-%d_%H:%M:%S").png. And click "Apply" at the bottom of the screen.

Repeat this process with your chosen shortcut for the print window command (import -window $(xdotool getwindowfocus) ~/Pictures/screenshot$(date +"%Y-%m-%d_%H:%M:%S").png) if desired.
Finally select "Global Keyboard Shortcuts" from the left. And "khotkeys" from the dropdown. Your new shortcuts should be listed. As is "PrintScreen" the launcher for KSnapshot. If desired click "PrintScreen" and click the "None" button to reassign it to a new shortcut.

- 2,929