How can I specify the default save directory for gnome-screenshot?
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:
- For Ubuntu 21.10
- For Ubuntu 18.04 +
- For Ubuntu 17.10 +
- For Ubuntu 12.04
Solution 1:
For 12.04
Via GUI
- 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:
-
Press Alt + F2 and type
dconf-editor
-
Go to
org
->gnome
->gnome-screenshot
-
At "auto-save-directory" type the desired directory in the following format:
file:///home/user/Desktop/
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/"
Solution 2:
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.
- Open dconf Editor.
- Navigate to
/org/gnome/gnome-screenshot/auto-save-directory
. - Disable Use default value.
- 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.
- Open Settings > Keyboard and scroll down to the bottom.
- Click on the + symbol. A box should pop up.
- Enter any name you like in the Name box.
- Enter
gnome-screenshot
in the Command box. - 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
.
Solution 3:
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.
Click over the gear icon, and place your desired place to save, prefixed with file://
as it's protocol to save.
This works too with symbolic link.
Solution 4:
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
Solution 5:
For 18.04 and later
First disable the default screenshot shortcut from settings:
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:
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: