Change default screenshot save location on Ubuntu

tl;dr

System settings are saved in the dconf configuration system, and you can edit them in a GUI with dconf-editor. But it doesn't work. It's a known bug considered as RESOLVED WONTFIX ref, so you'll never be able to change the save location just by editing dconf values for gnome-screenshot. Either create a custom keyboard shortcut that uses gnome-screenshot after setting the path in dconf-editor, or use gnome-tweaks with an extension called Screenshot Locations.

If you don't have any existing custom shortcuts, you can run this

# command to be added

the short fix

Now re-login. Open Tweaks, go to Extensions, and set your location.

the long fix

# install dconf Editor
sudo apt install dconf-editor

Start dconf Editor. Go to org / gnome / gnome-screenshot and edit auto-save-directory.

The location needs to be in file:///home/YOUR_USERNAME/Desktop format, i.e. an absolute path that starts with file://

For example, mine is a screenshots folder inside my ~/Pictures folder.

file:///home/aamnah/Pictures/screenshots

You can also set the config in the Terminal with gsettings set or dconf write

gsettings set org.gnome.gnome-screenshot auto-save-directory "file:///home/${USER}/Downloads/"

After all of this, it still won't work when you take a screenshot with Prtscr.. ¯_(ツ)_

You can use gnome-screenshot to save wherever you want, just create a custom keyboard shortcut for it in the keyboard settings panel. There won't be a configuration option to do this in gnome-settings-daemon, as it's already trivially possible to work-around this lack of configuration. Bastien Nocera

meh.. So, create a custom keyboard shortcut, shall we?

Go to Settings > Keyboard Shortcuts, there will be an entire section for Screenshots. You can either override these or create new ones with different key bindings.. If you are overriding an existing key combination, make sure you have disabled it first by clicking on it and pressing Backspace

Screenshot related shortcuts

Scroll down to the bottom and click the + button

Adding keyboard shortcuts

DescriptionShortcutgnome-screenshot command
Save a screenshot of a window to ~/Pictures/screenshotsAlt+Printgnome-screenshot -wb
Save a screenshot of an area to ~/Pictures/screenshotsShift+Printgnome-screenshot -a
Save a screenshot to ~/Pictures/screenshotsPrintgnome-screenshot

I also updated all names to say ~/Pictures/screenshots instead of Pictures. To check what flags are available, seeing man gnome-screenshot. -a is for selecting area, -w is for selecting window, and -b is for including borders when saving a window.

Custom keyboard shortcuts

Re-login for the change in location to take effect.

Links

Please note that this site and the posts on it are, and will always be, a work in progress. If i waited for perfection, i’d never get anything done.