140

Are there any sort of configuration options for specifying the default save location for gnome-screenshot, or is this hard-coded into the source code?

It used to be ~/Desktop, which seems to have changed to ~/Pictures (in 12.04).

The only possible solution I've seen is about Setting the default name (as it includes time stamp information now instead of simply 'Screenshot#'), but that solution doesn't really seem ideal to me.

Also, this post suggested that the last save location is remembered the next time you take a screenshot, but in my experience, this doesn't seem to be the case. And in any case, following on from that, that entry in gconf-editor doesn't even seem to accurately reflect the last location, so more than likely an entry related to an older version of gnome-screenshot.

Table of contents:

Juan Antonio
  • 1,572
trent
  • 2,364
  • 1
    I have opened a bug report as even though the folder is recorded it is not being used to preselect it. https://bugs.launchpad.net/ubuntu/+source/gnome-screenshot/+bug/1000534 – pt123 May 17 '12 at 03:23
  • 3
    Graphical methods below work, but what you really want to do is: gsettings set "org.gnome.gnome-screenshot" "auto-save-directory" "file:///home/$USER/screenshot" – Ciro Santilli OurBigBook.com Feb 10 '14 at 07:20
  • The problem for me was: I had the default folder set to ~/screenshots and it was working fine for a long time. Today I noticed that it was redirecting to a folder within that folder and couldn't be reset. It was actually an empty subfolder in this case. I deleted the subfolder and since then it has worked fine. – mcaleaa Jun 13 '13 at 10:12
  • 3
    If you are looking to change this using Gnome 3.8 or later, you are out of luck. The developers have decided to remove the ability to configure this. – palswim Jan 15 '19 at 20:38
  • @palswim GNOME seems to be more and more going the Windows 10 path - removing configurability for many things and forcing fixed solutions on users, "knowing better than users" what they want... :( – raj Feb 18 '21 at 15:29
  • I find it incredible that for this obvious configuration tweak, the recommended approach since 18.04 is to install an unofficial gnome shell extension (which all by itself is a security issue), via your browser (one of the hardest-to-secure parts of the whole system), and in fact via a browser extension, plus a native host connector tool. And that if you want to do it from the command line, you're pointed at example shell commands that need to be modified for each extension. What has system administration come to?? All your base are belong to whoever.... – nealmcb Oct 04 '21 at 03:25

22 Answers22

155

For 12.04

Via GUI

  1. Install dconf-editor
  • From the command line, run the command sudo apt-get install dconf-editor

  • Or click here to install from the Ubuntu Software Center:

    Install via the software center

  1. Press Alt + F2 and type dconf-editor

  2. Go to org -> gnome -> gnome-screenshot

  3. At "auto-save-directory" type the desired directory in the following format: file:///home/user/Desktop/

    name: auto-save-directory, value: file:///full/path/

A tip for anyone who is using the configuration editor in unity: click on the arrow to the left the org text to expand it.

Via Terminal

Simply run this command, replacing the path with your preferred directory.

gsettings set org.gnome.gnome-screenshot auto-save-directory "file:///home/$USER/Downloads/"
jokerdino
  • 41,320
desgua
  • 32,917
  • 1
    For what it's worth, this worked in Debian Wheezy for me. – Erik Youngren Jun 23 '12 at 04:42
  • 1
    Thanks desgua, this gave me less stress than changing it every time. – Luis Alvarado Feb 06 '13 at 16:03
  • NB It is auto-save-directory as mentioned in the text, not last-save-directory as highlighted on the screenshot – rds Oct 03 '13 at 12:43
  • @rds Well pointed. Updated. – desgua Oct 03 '13 at 22:00
  • Warning: using ~ in the path does not work, e.g. ~/Desktop and file:///~/Desktop fail silently (picture ends up in ~). – ntc2 Nov 14 '13 at 23:24
  • I have tried before and after using dconf-editor to set the auto-save directory, and my screenshots are not saved. I did a search on my home directory by modification date and there are no new files. Ubuntu 13.10. Any ideas? – Hatoru Hansou Feb 08 '14 at 10:28
  • Which directory exactly have you choose (file:///home...)? – desgua Feb 08 '14 at 13:07
  • 2
    it works without using files:// in ubuntu 14.04. Clrl+L will tell you the location . '/home/userName/location' – xkeshav Oct 30 '14 at 13:46
  • 1
    I like to have a subdirectory inside Pictures called screenshots; and it's a lot more handy to have that as default. I don't understand yet why the actual app does not provide the way to change this. – Akronix Dec 13 '14 at 12:51
  • 14
    Be aware that Gnome 3.8 doesn't use gnome-screenshot when using keyboard commands. – Andy May 13 '16 at 08:15
  • 5
    Not files:// but file:// – Reinier Post Aug 23 '16 at 20:43
  • 16
    Terminal method should be listed first since it's simpler. – dinosaur Jan 12 '17 at 21:37
  • Still works for Mint 18.1. – CoderGuy123 Jun 24 '17 at 17:17
  • I did through terminal and now my screenshot tool does not work anymore.

    (process:16744): dconf-WARNING **: failed to commit changes to dconf: GDBus.Error:org.gtk.GDBus.UnmappedGError.Quark._g_2dfile_2derror_2dquark.Code24: Failed to write file '/udd/MYUSER/.config/dconf/user.DFXC6Y': fsync() failed: Disk quota exceeded

    I got this error and then when I save the screenshot I am not able to open the picture

    – desmond13 Sep 10 '17 at 10:08
  • Now if I go in the GUI and I try to change the auto-save folder it does not allow me to do it. I enter the path but when I press ENTER it goes to the old value. Basically I was able to change it. Then I realized that it was not working and now I am not able to change it back. – desmond13 Sep 10 '17 at 10:19
  • @minidiable check this: https://askubuntu.com/questions/728863/cant-change-gedit-preferences-and-terminal-preferences-dont-save and this: https://unix.stackexchange.com/questions/67890/disk-quota-exceeded-problem – desgua Sep 11 '17 at 11:33
  • 8
    The Terminal gsettings method does not work on Ubuntu 18.04. There was no error or warning and screenshot still went to the default ~/Pictures/. dconf-edit doesn't work either! The auto-save-directory showed ~/Downloads/ but was ignored. All screenshots went to ~/Pictures/ – SYK Aug 14 '18 at 20:57
  • 1
    Ubuntu 18.04 - Using $USER does not work. Works with a fixed path, like: gsettings set org.gnome.gnome-screenshot auto-save-directory '/home/jgr/ScreenShots' – estibordo Oct 24 '18 at 23:08
  • @estibordo your solution still does not work for me on 18.04.2. tried single and double quotes. when i do GET, i can see it is set. same way as with var $USER ... :( – secretAgent May 20 '19 at 17:04
  • https://bugs.launchpad.net/ubuntu/+source/gnome-screenshot/+bug/977228 reported 2012-04-09 – secretAgent May 20 '19 at 20:42
  • @SYK This answer is not adequate anymore for Ubuntu 18.04. See the others answers below (useful answers now contain headers to clarify the scope of the answers). – pomsky Jun 28 '20 at 15:00
37

For 18.04 and later

For those who wondering why is it still not working, this bug is considered as RESOLVED WONTFIX, here's the sauce.

For the workaround, you can install an extension for this. Just turn on the switch, and go to your Tweak Tool, head over the Extensions tab, and find Screenshot locations.

Tweak tool screenshot SS

Click over the gear icon, and place your desired place to save, prefixed with file:// as it's protocol to save.

Settings SS

This works too with symbolic link.

pomsky
  • 68,507
33

For 17.10 and later

Turns out it's not so straightforward while capturing a screenshot with the PrintScreen key in GNOME version 3.8 or later.

First you may try to set ~/Desktop (for example) as the autosave directory for gnome-screenshot following the steps below.

  1. Open dconf Editor.
  2. Navigate to /org/gnome/gnome-screenshot/auto-save-directory.
  3. Disable Use default value.
  4. Put file:///home/YOUR_USERNAME/Desktop in the Custom value box.

Alternatively, you may just run the following command in Terminal:

gsettings set org.gnome.gnome-screenshot auto-save-directory 'file:///home/YOUR_USERNAME/Desktop'

But even after doing this if you press PrintScreen, captured screenshots will be saved in ~\Pictures on GNOME 3.8 or later (see this bug report).
So as a workaround you may now add another custom keyboard shortcut for gnome-screenshot which will save captured screenshots to ~/Desktop. To do that follow the steps.

  1. Open Settings > Keyboard and scroll down to the bottom.
  2. Click on the + symbol. A box should pop up.
  3. Enter any name you like in the Name box.
  4. Enter gnome-screenshot in the Command box.
  5. Click on the Set Shortcut... button and set any keyboard combination which doesn't cause any conflict, for example Super+PrintScreen.

Then logout and login again. Now Super+PrintScreen should save the captured screenshot in ~/Desktop.

P.S. For convenience you may first change the shortcut for "Save a screenshot to Pictures" to something else like Super+PrintScreen or disable it completely and then assign PrintScreen to the custom shortcut you just created.


You can refine what type of screenshot you want by using following flags in the command box (gnome-screenshot <FLAGS>):

  • -a (for 'area') will let you select the area to take the screenshot of using your mouse;
  • -w (for 'window') will take a screenshot of the currently active window only (and not the whole screen);
    • -b will include window's border in the screenshot,
    • -B will not include the border,
  • -p (for 'pointer') will include the mouse pointer in the screenshot (won't have any effect with -a obviously);
  • -i (for 'interactive') will let you set the options in a poping-up dialog.

You can combine flags together: e.g., gnome-screenshot -wB will take a screenshot of currently active window without its border.

You can get the exhaustive list of available options/flags via man gnome-screenshot.

pomsky
  • 68,507
  • 2
    +1 because I was looking for a fix. Although this is not a fix and possibly the only workaround because after checking the bug report, the gnome team does NOT want to fix this (Which it was fine in previous versions). I also did everything you mentioned so I will be either be doing your suggestion that works or moving to KDE (At least they offer options). – Luis Alvarado Nov 07 '17 at 00:29
  • 2
    If you want to emulate the "area screenshot" (where you draw a selection on your screen with your mouse), you should enter gnome-screenshot -a in the command box. As detailed in man gnome-screenshot, you can replace (or add to) -a with: -c to copy the image in clipboard (so you can Ctrl+V it), instead of a file; -w if you want to copy the current window; etc. – ebosi Oct 16 '18 at 11:46
  • Another related bug report: https://gitlab.gnome.org/GNOME/gnome-settings-daemon/issues/323 – Wildcard Nov 09 '19 at 06:54
  • Also note, as mentioned in @doug 's answer, that -i / --interactive will also use the last directory, which can be useful when you don't want to change the default save directory for every new activity, but a given activity always uses the same directory. – hsandt Jul 25 '22 at 11:11
18

For 12.04

It can be be configured in 12.04 for 'auto save' & when using gnome-screenshot itself, gnome-screenshot --interactive, where the last save directory is used

What does seem to always default to Pictures is from the keyboard bindings (bug or intended?

Earlier in 12.04 the screens from the keyboard bindings used auto-save, people complained & it was returned to interactive

Both settings for gnome-screenshot are in gsettings & dconf-editor

enter image description here

jokerdino
  • 41,320
doug
  • 17,026
  • Oh right. It does use that last save directory setting when using interactive, but introduces an additional dialog for what you want to grab - I guess this is the best I'll get. Thanks :-) – trent Mar 20 '12 at 22:13
  • 1
    How do you set the called argument --interactive when pressing CTRL Print? – rubo77 Jan 04 '16 at 22:37
  • @rubo77 (works on Ubuntu 20.04) Personally I just defined a custom Keyboard shortcut "Take screenshot to last directory" that runs "gnome-screenshot --interactive". There "Grab the whole screen" should be selected by default (which should replace your Ctrl), but you still need to press Enter to confirm options. Then you'll have the usual popup with last directory selected. Not sure why we cannot have the last directory selected without the whole options selection part... – hsandt Jul 25 '22 at 11:09
15

For 18.04 and later

First disable the default screenshot shortcut from settings:

Disable default screenshot shortcut

Create a custom keyboard shortcut in the settings:

Name it gnome-screenshot, put the command as gnome-screenshot as well

Shortcut value : enter the key [Print Screen]

Create a custom shortcut:

Create a custom shortcut

Now enter into dconf-editor (Install it if you do not have it yet). Go to: org → gnome → gnome-screenshot → auto-save-directory: Change the auto save directory's custom value to the one you want.

Enter the custom path:

Enter the custom path

  • what is the name and command for Save a screenshot of an Area to Pictures. I repeated your answer with Shift+Print but it saves the full-screen screenshot instead of prompting for area. – mr.loop Jan 17 '22 at 17:32
  • got it gnome-screenshot -a – mr.loop Jan 17 '22 at 17:38
5

For 18.04 and later

Install the GNOME Shell extension Screenshot Locations by TimurKiyivinski. Kudos to him for packaging the changes that the GNOME-team developers didn't want to implement into an extension and thus making it really simple to work around the issue.

EDIT: You still need to change the default path using dconf editor, obviously.

pomsky
  • 68,507
yago
  • 61
  • 1
  • 3
3

For 21.10 and later

I tried the answer labelled as "For 18.04 and later". However, it did not work in my 21.10 installation. Luckily, after some trial and error, I found a workaround which is a simple modification to that one.

The basic workaround is not to use the Tweak tool as the Extensions does not seem to show. Instead, install the Screenshot Locations extension then go to your Gnome Installed Extensions page and then click on the configuration button for the Screenshot location extension and select the folder you want and voilà.

Here is a screenshot of the configuration window: screenshot of configuration window

Juan Antonio
  • 1,572
2

Because the default screenshot application always stores the screenshots below $HOME/Pictures and there is no apparent way to reconfigure that directory I wrote a combination of systemd user units to monitor the directory $HOME/Pictures. Whenever something in that directory changes, all files named $HOME/Pictures/"Screenshot from"* are moved to the subdirectory $HOME/Pictures/Screenshots.

Here is what I did:

Create a file /etc/systemd/user/screenshot-mover.path:

[Unit]
Description=Screenshot Watcher
Documentation=man:systemd.path
AssertPathIsDirectory=%h/Pictures
AssertPathIsDirectory=%h/Pictures/Screenshots

[Path]
PathChanged=%h/Pictures

[Install]
WantedBy=default.target

Create a file /etc/systemd/user/screenshot-mover.service:

[Unit]
Description=Screenshot Mover
Documentation=man:systemd.service
AssertPathIsDirectory=%h/Pictures
AssertPathIsDirectory=%h/Pictures/Screenshots
ConditionPathExistsGlob=%h/Pictures/Screenshot\ from*

[Service]
Type=oneshot
WorkingDirectory=%h/Pictures
ExecStart=/bin/sh -c '/bin/mv -v -t Screenshots "Screenshot from"*'

Then, for every user who wants this mechanism, issue:

systemctl --user daemon-reload
systemctl --user enable --now screenshot-mover.path

Do not run these commands as root, but as your user.

What it does:

Whenever something in the path $HOME/Pictures changes, the unit screenshot-mover.service gets called and moves every file that matches $HOME/Pictures/"Screenshot from"* to the subdirectory $HOME/Pictures/Screenshots. I know it is a hack but this approach works for me since months and I just wanted to share it.

PerlDuck
  • 13,335
2

This answer is rather addition to pomsky's answer.

On Ubuntu 18.04 Bionic Beaver it is possible to use AltGr to change some default behaviour. For example, my current settings have:

  1. Print for gnome-screenshot command
  2. Shift+Print for gnome-screenshot -a
  3. Super+Print for gnome-screenshot -wB (no chance to redefine Alt+Print)

To set those I used AltGr in addition to shortcuts themselves. (Thanks for asking RichieHH)

Custom shortcuts in keyboard settings

Additionally, default commands become disabled.

Screenshot section in keyboard settings

And a little note. Obviously, there is no sense to change shortcuts for copying screenshots to clipboard.

Maks_ym
  • 21
  • What has AltGr got to do with anything in your answer? – RichieHH Nov 30 '18 at 09:29
  • @RichieHH to set those shortcuts you I had to press AltGr as well (in addition to shortcut itself) to avoid making screenshots. – Maks_ym Nov 30 '18 at 12:47
  • @RichieHH Added to my original answer as well. Thanks – Maks_ym Nov 30 '18 at 12:53
  • 1
    I think this should be the accepted answer, but perhaps it should explain a bit better, that you have to keep pressing AltGr and then your desired combination, in order to replace the desired combination if it has been taken already, and that's how you can also replace the printscreen. – Ferenc Géczi Jun 19 '20 at 09:38
2

In 12.04 (haven't looked in previous versions of Ubuntu because I never faced this problem) you have to set the auto-save-directory-setting to the desired location where you want your screenshots to be stored. By doing so every time you take screenshot it will automatically land there. I also prefer to use ~/Desktop and you are also not prompted to specify a destination like before. The only thing that indicates that you have taken a screenshot is a short flash of the screen. However I would love to know how to get the prompt back because I sometimes like to store screenshots in other folders than the default one and it would be overkill to either change the settings or move the image every time.

  • Where are you setting the auto-save-directory ? – fabricator4 Dec 12 '12 at 19:49
  • Look at @doug's comment above my answer. In the picture of the configuration editor in the section of gnome-screenshot the first setting is auto-save-directory. Just write there the location of the desired folder (Desktop for example) and you're ready to go. :) In his example it is set to "Documents". – rbaleksandar Dec 14 '12 at 16:50
2

For Ubuntu 13.10 (Saucy Salamander)

  • Install dconf-editor

  • Open it and go to: org → gnome → gnome-screenshot

  • At auto-save-directory type the desired directory in the following format: /home/user/Desktop/

P.S.: Do not put in this format file:///...

jokerdino
  • 41,320
FSX
  • 21
  • 1
1

This answer is based on this answer

As I wanted to use custom shortcuts in addition to custom screenshots location, I wanted to do this manually in terminal.

(1) I have created gshort Bash function based on this answer. Of course, you can do it in Perl or manually, but I too lazy to issue all the commands manually whenever I want to create a new shortcut. … Anyway, if you use this function, you need to save it to file, source that file (source path/filename.sh).

(2) And then issue these commands:

# Disable these 6 default shortcuts
gsettings set org.gnome.settings-daemon.plugins.media-keys screenshot ''
gsettings set org.gnome.settings-daemon.plugins.media-keys screenshot-clip ''
gsettings set org.gnome.settings-daemon.plugins.media-keys window-screenshot ''
gsettings set org.gnome.settings-daemon.plugins.media-keys window-screenshot-clip ''
gsettings set org.gnome.settings-daemon.plugins.media-keys area-screenshot-clip ''
gsettings set org.gnome.settings-daemon.plugins.media-keys area-screenshot ''

# Create new custom shortcuts
gshort "Screenshot of area" 'gnome-screenshot -a' "<Shift>Print"
gshort "Screenshot clip of area" 'gnome-screenshot -a -c' "<Primary><Shift>Print"
gshort "Screenshot" 'gnome-screenshot' "Print"
gshort "Screenshot clip" 'gnome-screenshot -c' "<Primary>Print"
gshort "Screenshot clip of area" 'gnome-screenshot -a -c' "<Primary><Shift>Print"
gshort "Screenshot clip of window" 'gnome-screenshot -w -c' "<Primary><Alt>Print"

(3) Note that the syntax of gshort is gshort "Name" "command" "shortcut": - name can be anything you wish; - command can be any command you wish; - shortcut can be any keybord shortcut you wish.

(4) Here is the list of some control key names that you need to use in shortcut:

  • Ctrl : <Primary>;
  • Alt : <Alt>;
  • Shift : <Shift>;
  • Super/Win: <Super>;
  • 1
    In Ubuntu 20.10 the disable value is [] not ''. e.g.: gsettings set org.gnome.settings-daemon.plugins.media-keys screenshot [] – thanos.a May 05 '21 at 10:40
  • 1
    @thanos.a, I think this depends on the GNOME Shell version instead of the Ubuntu version. I have encountered this with some other gsettings settings. – tukusejssirs May 05 '21 at 15:12
1

For Gnome 41.5 and later

I've tried this extension (called "Screenshot Locations") as it was suggested in other answers and I noted it is not compatible with my system (arch with gnome 41.5). So that, I looked for another one (called "Screenshot Directory") and it works great!!

Solved with:
https://extensions.gnome.org/extension/4031/screenshot-directory/

1

You don't need an Extension for such a simple task, instead do as following:

1- Backup your the Pictures folder

2- Delete the Pictures folder

3- Create a symbolic link to your desired screenshots directory and name it "Pictures"

4- Move the symbolic link to /home

Just to add on here...

You can create a symbolic link from your desired location to the place that gnome-screenshots forces. That might be ~/Pictures/Screenshots if you have Pictures defined.

If you're like me and you have XDG_PICTURES_DIR="$HOME/" in your .config/user-dirs.dirs to eliminate Pictures from Nautilus, then gnome-screenshots will put the folder in your home directory as ~/Screenshots.

After you create a link from your desired location, for example:

ln -s ~/.screenshots ~/Screenshots

then you can put a file at ~/.hidden containing

Screenshots

and it will keep it from showing in Nautilus.

Not ideal, but it keeps things looking tidy.

  • 1
    Very bad idea to delete any default system directory. – David Sep 26 '22 at 11:10
  • That's a good general rule, except there's nothing "system" about Screenshots or Pictures.

    Screenshots is just the directory of one userspace app, i.e. gnome-screenshots.

    And xdg-dirs is a totally optional system for defining default directories for apps. Shotwell can check xdg-dirs if there's a Pictures folder defined and if there isn't, you just define your own.

    And opting in and out of specific definitions in xdg-dirs as your needs dictate is a documented feature.

    It's just a shame that gnome-screenshots doesn't let you define the destination directory.

    – brianmercer Sep 27 '22 at 12:59
0

You can set the default save directory of screenshots in CompizConfig Settings Manager.
Launch it, choose Screenshot under the Extras category. You can then choose the default directory you wish to use.

enter image description here

yossile
  • 5,728
0

Screenshot a area and save at the chosen folder

By Terminal

Note: If you to cancel, instead you chosen a folder, the terminal will be close

gnome-screenshot -a -f "$(zenity --file-selection --directory || kill -9 $PPID)/PrintSc $(date '+%Y-%m-%d %H-%M-%S').png"

If you don't want close it, if you to cancel your screenshot will be save in the folder "~/Pictures", with this:

gnome-screenshot -a -f "$(zenity --file-selection --directory || echo ~/Pictures)/PrintSc $(date '+%Y-%m-%d %H-%M-%S').png"

By a Shortcut

You could create a shortcut (super+PrintSc) with this script bellow:

sh -c "gnome-screenshot -a -f \"$(zenity --file-selection --directory || kill -9 $PPID)/PrintSc $(date '+%Y-%m-%d %H-%M-%S').png\""
0

Full single click solution for Gnome 41.2+

Full solution, just copy to a sh file and execute the file. This will:

  1. remove the default screenshot shortcuts as we need those keyboard shortcuts for the custom shortcuts.
  2. create folder /Pictures/Screenshots.
  3. Set auto-save dir to that new folder.
  4. Create new custom shortcuts as the auto-save dir only applies to custom screenshots. I have chosen shortcuts with the least number of keys and ones that make sense to me for most people. Feel free to choose other keys.

Note: Tested on Manjaro Gnome 41.2

Note: If you have other custom shortcuts, please note the key custom-keybindings is actually an array that you need to expand. In the below, as an example below I first create a custom shortcut for gnome-terminal, next I add 4 custom shortcuts for screenshots.

# Keyboard shortcut: Ctrl+Alt+T opens Terminal
gsettings set org.gnome.settings-daemon.plugins.media-keys custom-keybindings "['/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/']"                  
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/ name 'Terminal'         
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/ command 'gnome-terminal'
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/ binding '<Ctrl><Alt>T'

Remove Gnome default screenshot shortcuts as they will always be stored in /Pictures instead of /Pictures/Screenshots

gsettings set org.gnome.settings-daemon.plugins.media-keys area-screenshot "@as []" gsettings set org.gnome.settings-daemon.plugins.media-keys window-screenshot "@as []" gsettings set org.gnome.settings-daemon.plugins.media-keys screenshot "@as []" gsettings set org.gnome.settings-daemon.plugins.media-keys area-screenshot-clip "@as []" gsettings set org.gnome.settings-daemon.plugins.media-keys window-screenshot-clip "@as []" gsettings set org.gnome.settings-daemon.plugins.media-keys screenshot-clip "@as []"

Create Screenshots folder

mkdir $HOME/Pictures/Screenshots gsettings set org.gnome.gnome-screenshot auto-save-directory "file:///home/${USER}/Pictures/Screenshots/"

Create custom screenshot shortcuts, only custom shortcuts ARE stored to the auto-save-directory

gsettings set org.gnome.settings-daemon.plugins.media-keys custom-keybindings "['/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom3/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom4/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom5/']"
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/ name 'Area screenshot to custom folder' gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/ command 'gnome-screenshot -a' gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/ binding 'Print' gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/ name 'Area screenshot to clipboard' gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/ command 'gnome-screenshot -a -c' gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/ binding '<Shift>Print' gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom3/ name 'Window screenshot to custom folder' gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom3/ command 'gnome-screenshot -w -p' gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom3/ binding '<Alt>Print' gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom4/ name 'window screenshot to clipboard' gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom4/ command 'gnome-screenshot -w -c' gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom4/ binding '<Primary>Print' gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom5/ name 'Interactive screenshot to cust folder' gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom5/ command 'gnome-screenshot -i -p' gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom5/ binding '<Primary><Shift>Print'

zilexa
  • 171
0

You don't need an Extension for such a simple task, instead do as following:

1- Backup your the Pictures folder

2- Delete the Pictures folder

3- Create a symbolic link to your desired screenshots directory and name it "Pictures"

4- Move the symbolic link to /home

0

Since the gsettings solution no longer works, and the Gnome Extensions site claims the "Screenshot Locations" extension is incompatible with my system (Ubuntu 22.04), I gave up on elegance and elected to just symlink both ~/Pictures/Screenshots and ~/Videos/Screencasts to the folder that I prefer those files end up in - in my case, ~/Downloads, which I use as my general inbox.

Just tested both and it works. Only downside is having to see those symlinks in the Pictures and Videos folders.

odigity
  • 428
0

If you can't/wan't install dconf-editor or any other software, simply open, or create if it doesn't exist, this file, with your preferred text editor:

~/.bash_aliases

Add this line, that create a permanent alias gss (you can choose another alias name):

alias gss='gsettings set org.gnome.gnome-screenshot auto-save-directory "$(echo $PWD)"'

then every time you need to save several screenshots in a specific and different path simply one a terminal in that path and execute:

gss

from now on every time you press the gnome-screenshot keyboard shortcut you will be prompted or you will check for the screenshot image file in that path.

dessert
  • 39,982
Ian
  • 1
-2

On Elementary OS Juno which is based on Ubuntu 18.04, even after you remove all the screenshots tools like gnome-screenshot or screenshot-tool, you can still use PrtSc or Shift+PrtSC to take a screenshot. So when the PrtSc, actually a different screenshot tool is called and by default the picture is saved to XDG_PICTURES_DIR. You can modify this environment variable XDG_PICTURES_DIR in ~/.config/user-dirs.dirs,

# This file is written by xdg-user-dirs-update
# If you want to change or add directories, just edit the line you're
# interested in. All local changes will be retained on the next run.
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported.
# 
XDG_DOWNLOAD_DIR="$HOME/Downloads"
...
XDG_PICTURES_DIR="$HOME/Pictures/screenshots"

So maybe on Ubuntu GNOME 17.04, it's also the case. Then you can also use the above method to change the location of saved screenshot.

Coiby
  • 167
  • Changing XDG_PICTURES_DIR to $HOME/Pictures/screenshots defeats the goal for all intents and purposes really. The idea was to not use the default pictures folder (which is dictated by XDG_PICTURES_DIR) for saving screenshots, instead to use a different dedicated folder. Your answer suggests marking the dedicated screenshots folder itself as the default pictures folder. So this screenshots folder would be used as the default pictures folder for all purposes after making this change. – pomsky Jun 26 '20 at 23:42
-3

For those who can't install dconf-editor and are terminal users, I would suggest to edit the .bashrc file in your home directory. Put anywhere in the file the line "mv ~/Pictures/Screenshot* ---put-here-desired-path---". The only problem with this method is that, in case you have a file starting with the string "Screenshot", it will be moved to the desired path you've put above.