5

I recently upgraded from Ubuntu 20.04 to 22.04. I have to change my screenshot directory from /home/<usr_dir>/Pictures/Screenshots to another path. I could do this in Ubuntu 20.04, but I am not able to do it in 22.04.

How can I do this?

Raihan
  • 371

2 Answers2

2

I have just installed gnome-screenshot on 22.04 LTS with:

sudo apt install gnome-screenshot

and there appears not to be any option to change the default directory from Home/Pictures/Screenshots in this version of GNOME.

Using Terminal

However, selecting gnome-screenshot -h in terminal provides a help file with this utility, from which can be seen that invoking the tool with -f, --file=filename will save the file directly to the file specified.

So then the actual syntax (assuming you have a directory called screens under Downloads in your Home directory) will be:

gnome-screenshot -f [myfile]

and that will save the screenshot to a file called [myfile] in that directory. Change the filename to what you require, of course.

Doing this in a terminal holds no issue, since you can easily use terminal shortcuts to reverse search the terminal at the command line prompt. Specifically, you can find the earlier command using Ctrl+r and beginning to type any part of the command to present options, and then change the command as required. Another option would be to use to scroll back through earlier commands, but that might be a bit tedious.

This will of course capture the whole screen in the chosen directory, but there are other options which can be set, such as --area, as you will see from the help file.

Use dconf-editor

An alternative method is to change the path of the autosave directory by using dconf-editor.

dconf-editor is not installed by default, so to install it open a terminal and run:

sudo apt install dconf-editor

You can then run the utility either from terminal with dconf-editor or select the GUI directly from Show Applications.

Once in the editor, select apps and then click Search "apps" folder and enter screenshot in the search box. Then select /org/gnome/gnome-screenshot/ from the list presented.

dconf-editor screenshot search

The next step is to select auto-save-directory and disable Use default value, after which you can then enter a custom value in the field provided.

Using the example above, enter /Home/Downloads/screens (or the path of your choice) and save accordingly.

Custom value in /org/gnome/gnome-screenshot/

On entry to the utility and at the point of saving the image, you can override the defaults to any folder of your choice (or filename), which will be remembered the next time you use the tool.

enter image description here

graham
  • 10,436
  • 1
    First of all, thank you very much for the reply. I have tried the method you specified above and it did work. But I want the same UI that the default screenshot shows. So please do suggest a method that will work like that.

    Thanks.

    – Raihan Apr 24 '22 at 10:07
  • perhaps you could explain further so I can edit my answer accordingly? If you regard the solution proposed as a suitable work-around, perhaps you would be kind enough to consider this reference? – graham Apr 24 '22 at 11:53
  • Your welcome. So is there a solution to the problem I mentioned the day before?

    Thanks.

    – Raihan Apr 25 '22 at 11:18
  • possible solutions are contained in the answer provided. You might wish to accept and upvote accordingly to help others find the solution. – graham Apr 25 '22 at 11:48
  • I mean is there any other solution, cause I want to use the default UI presented. – Raihan Apr 25 '22 at 14:13
1

An easy way without dconf is to create a symlink to the folder where you want to place screenshots, which has the name Screenshots and is located in /home/<user_name>/Pictures, of course deleting the default folder of screenshots.