How can I specify the default save directory for gnome-screenshot?
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/"
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
.
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.