I use Ubuntu 14.04 LTS, and when I take the screen shot, the default file name is given like Screenshot from 2016-02-29 11:08:10.png. I do not want the file name to have a space () and a colon (:). How can I change the file naming scheme?
- 161
- 1
- 6
-
@norio, would you be alright if the only mode where it doesn't work is interactive ? DK Bose's answer pretty much is the best solution. For some odd reason developers decided to disable filename option in the interactive mode , and we don't have much control over that, i suppose – Sergiy Kolodyazhnyy Mar 01 '16 at 06:41
2 Answers
Use the -f option as described in man gnome-screenshot:
-f, --file=FILENAME
Save screenshot directly to this file.
So, try
gnome-screenshot -f Screenshot_from_$(date "+%Y-%m-%d-%H%M%S").png
On my system, the image is saved to my home folder. If you want it to be saved elsewhere, you need to specify the path like this, for example:
gnome-screenshot -f ~/Pictures/Screenshot_from_$(date "+%Y-%m-%d-%H%M%S").png
Read http://www.foragoodstrftime.com or man date for more on formatting dates.
- 41,240
- 22
- 121
- 214
Setting the naming for file in gnome-screenshot is hardcoded into the source, specifically the screenshot-filename-builder.c part of the source code. If you specifically want to use gnome-screenshot, your best bet is to alter the source code.
There also are no external settings for that.
grep '<key.*\=' /usr/share/glib-2.0/schemas/org.gnome.gnome-screenshot.gschema.xml
<key type="b" name="take-window-shot">
<key type="i" name="delay">
<key type="s" name="auto-save-directory">
<key type="s" name="last-save-directory">
<key type="b" name="include-border">
<key type="b" name="include-pointer">
<key type="b" name="include-icc-profile">
<key type="s" name="border-effect">
<key name="default-file-type" enum="org.gnome.gnome-screenshot.file-types">
You could always use the --file= flag in conjunction with date program. DK Bose actually posted this solution earlier, which baffles me why he deleted it. One could connect gnome-screenshot --file="$(date +%Y-%m-%d-%H%M%S).png" to a shortcut. That's the closest to what OP wants. And you could always seek alternatives,too, for instance shutter is a popular screenshot software on Linux, but I've never used it myself, so cannot endorse
- 103,293
- 19
- 273
- 492
-
I undeleted my answer! I confused `--interactive` with `--area` in my mind. Thanks for pointing out that my answer is satisfactory. – DK Bose Mar 18 '16 at 13:26
-
1@DKBose yup, no problem. Keep up the good work ! I've already had your answer upvoted – Sergiy Kolodyazhnyy Mar 18 '16 at 13:41