2

For Windows, IrfanView offers a powerful screenshot tool with these features:

  • Custom filenames (number and timestamp) such as 000001_20170324110124.Screenshot.png (not an actual filename of a file I have, just an example. I did not use the timestamp of right now (20181107…) to avoid confusions with GMT). The number is useful for navigating to a screenshot quickly by a file manager's/terminal's automatic filename completion and to add oversight. The word “Screenshot” makes it easier to find screenshots using file search.
  • Does not reserve clipboard. (if I wish to take a screenshot to the clipboard, I can just manually use the gnome-screenshot command)
  • Ability to save screenshot immediately. No need to confirm or interact with a dialogue that may accidentially be closed by pressing the Escape key, eliminating the screenshot.

IrfanView just makes a Windows notification sound each time a screenshot capture is triggered. But nothing beyond that.

Mate screenshot offers no possibility to save the screenshot without encountering the confirmation dialogue. At least no delay, memorizes path,works without sound or screen effect and does only reserve the clipboard if manually wanted by the user. Edit: On Xfce, mate-screenshots from mate-utils does make a camera noise. Not that I think the noise is ugly but it might block a word from background audio I am listening to.

Gnome screenshot uses a screen blackout effect which I would not prefer. Not that it looks ugly, it just blocks the entire screen for a short moment. Additionally, it does not memorize the previous screenshot folder and always sets it to ~/Pictures. At least, gnome-screenshot and mate-Screenshot both support bookmarks.

How can I capture a screenshot and save it immediately with the press of one button?

If I can set a bonus key such as G2 (not available on all keyboards), that would be great. Also custom filenames would be nice to have, but mainly, I just wish to capture screenshots with the press of one button.

7
  • 2
    What happens when you press the PrintScreen key? For me (in Lubuntu), it does what I think you want. You can install scrot, if you want another program than what comes with your Ubuntu MATE. If you run scrot without options, it will save the screenshot 'directly' without any questions, and you can create a hotkey for it if you wish.
    – sudodus
    Nov 7, 2018 at 20:19
  • @sudodus +1, but can I set a destination folder?
    – neverMind9
    Nov 7, 2018 at 20:31
  • 2
    A date-stamped file will be dropped in the current directory (by scrot). So you can create a shellscript, that changes directory to where you want the screenshot to be dumped, and then runs scrot`. (And that shellscript can be called via a hotkey.)
    – sudodus
    Nov 7, 2018 at 20:36
  • 1
    If you wish, you can write an 'answer' and share the details of your solution :-)
    – sudodus
    Dec 4, 2018 at 7:04
  • 1
    @Sudodus Here is the script: askubuntu.com/a/1098319/782651.
    – neverMind9
    Dec 4, 2018 at 8:19

2 Answers 2

3

I created a tiny bash script to facilitate the screenshot process.
However, it only runs in bash and not in dash (also known as sh ) when trying to bypass the octal number limitation.

##SCR NUM - RUN WITH BASH instead of sh.
scrdir=/path/to/screenshots
if ! [ -e $scrdir ]; then mkdir $scrdir; fi

counter=$(cat "./.count") #import the counter variable from last saved state.
number=$(printf '%07d' $(( 10#$counter )) ) #import number variable for leading zeroes from the original counter variable. If leading zeroes are not needed, the $counter variable can be used directly in the file name.

scrot -m $scrdir/Scr.$number.%Y%m%d%H%M%S.png # -e 'mv $f /path/to/screenshots' #save file with number and YYYYMMDDHHMMSS timestamp.
number=$(( 10#$number+1 )) #add +1 to screenshot counter.
counter=$(printf '%00d' $(( 10#$number)) ) #get number without leading zeroes from $number to avoid compatibility issues. 10#$ bypasses the octal number limitation and only works in bash, not in dash.
echo $num >"./.count" #save +1 increased screenshot counter back to .count file.

You can adjust some parameters to match your own personal preferences.

  • The -m option captures all monitors (if multiple monitors are in use) according to man scrot.
  • %07d puts six zeroes ahead of the screenshot counter for better file sorting in older file managers. The seven zeroes, of which some are redundant, are just for aesthetic reasons in my case (i.e. 0000001), not because I would actually max out that counter during a lifetime.
  • -e 'mv $f /path/to/screenshots' moves the taken screenshot to the desired destination afterwards. (Deprecated.)
  • The .count file stores the screenshot counter.
  • The additional $number variable is solely for the filename and gets generated from $count but with leading zeroes, as seen in the script.
  • Another advantage, besides more organized file names, of having a number in the file name, is that more than one screenshot can be taken in the same second without the previous one being overwritten, although this is rather rare.

In the system's keyboard settings, you can assign a keyboard shortcut to the script, but type the word bash infront of it. It will execute each time you push the hotkey, PrintScr in my case.

2

You can both use custom directory to save screenshots and have filenames with timestamps with gnome-screenshot. You need to use the following command.

gnome-screenshot -f /path/to/preferred/folder/screenshot_$(date "+%Y%m%d%H%M%S").png

Then you can set a keyboard shortcut for the command above.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .