Feature request: change screenshot directory

Implement either some way to modify the directory where screenshots are saved OR update the extension that no longer works with GNOME 43. This is obviously something people want to be able to control *and has been for well over a decade! ( How can I specify the default save directory for gnome-screenshot? Asked 10 years, 11 months ago)

The linked Discourse topic is not an example of users wanting to change the screenshots directory. It was about a configuration error for XDG_PICTURES_DIR in ~/.config/user-dirs.dirs which caused screenshots — as per that configuration — to be saved in ~/Screenshots instead of in ~/Pictures/Screenshots.

Screenshots are saved to XDG_PICTURES_DIR/Screenshots, with the “Screenshots” part localized to the user’s language. This is hard coded in the new builtin screenshot tool, and in some apps that can take screenshots of their windows like Boxes and Videos.

Why? I’m genuinely asking what use has it for you to be able to change where screenshots are saved?

“Why? I’m genuinely asking what use has it for you to be able to change where screenshots are saved?”

While the Discourse discussion may not specifically be about changing the location, the fact that the askubuntu question I provided has 140 upvotes and a lot of activity suggests that there have been a lot of people who want to change the location. Second, the very fact that an extension has existed to change the directory indicates a user desire for this feature.

Your question as to why I—in particular—want to change the directory is relatively irrelevant. I want to do it, Linux is supposed to be customizable, and this is apparently—and very frustratingly—locked. Regardless, it is anathema to me that folders with capital letters exist in my home directory by XDG default. It is therefore very inconvenient that I cannot tell the screenshot application to use ~/pictures/screenshots or ~/screenshots (or even my /library/pictures/screenshots or /library/screenshots or … so that it is on my data drive instead of my SSD /home). I also like to occasionally (annually or monthly) add a directory based on the time (e.g., …/screenshots/2023)…but again, that’s really moot in this discussion: clearly there is a desire amongst users for this or the askubuntu discussion that has been continuously updated for over a decade and the extension wouldn’t exist.

Why can’t there be some sort of environmental variable that could be set so that instead of using XDG_PICTURES_DIR/Screenshots it could use that? I don’t know what downstream implications there will be from changing XDG_PICTURES_DIR and I don’t really want to start messing around with that when all I want to do is have the built in save the f—ing screenshots where I want instead of where GNOME orders me they must be saved.

The alternate I guess is to go back to Shutter which I was really hoping to avoid because the built-in already uses resources and it is usually sufficient for what I need. The only thing Shutter offers—aside from specifying the screenshot directory—is the ability to go back and edit the SS so I can obscure information. The uploading to Imgur is occasionally useful, but it doesn’t save that much work.

https://www.google.com/search?q=ask+ubuntu+how+to+change+screenshot+directory+site%3Aaskubuntu.com
About 16,200,000 results (0.55 seconds)

I’m not going to argument for/against this, but specific use cases do matter. If it turned out that e. g. the reason everyone wanted this was to change the directory to another specific location, we should just consider changing the default screenshot directory to that (unlikely, but still).

Just adding an option because «it’s supposed to be customizable» is a recipe for a cluttered experience and a lot of extra maintenance work. Each option/preference needs to be evaluated carefully, not because user choice is inherently bad, but because having too many preferences impacts the quality and maintainability of the app. All of this is a core part of GNOME’s design philosophy.

As this is something that seems to impact users with alternative folder structures, it’s very possible that a preference should be added. However, since it’s unchangeable as of now, I suspect that there is a reason for it being that.

1 Like

I’m not going to argument for/against this, but specific use cases do matter. If it turned out that e. g. the reason everyone wanted this was to change the directory to another specific location, we should just consider changing the default screenshot directory to that (unlikely, but still).

Fair enough… All of what you said are good points, but things are “oversimplified” in some of the GNOME applications, e.g., there’s no way to modify the recording parameters in gnome-sound-recorder or the directory that the files get saved in (starting to see a theme here?). It doesn’t even default an extension…?

However, since it’s unchangeable as of now, I suspect that there is a reason for it being that.

The actual feature request includes “OR update the extension that no longer works with GNOME 43.” I realize that the author of the now-incompatible extension is unlikely to actually be an author of the GNOME screensaver. However, I imagine that if you are an author of the screenshot app, fixing the extension should be relatively trivial and is an efficient workaround for this use case…but that’s just a wild supposition.

I suppose that another workaround would be to create a service to monitor XDG_PICTURES_DIR for the creation of Screenshots and then just move the files where I want them and then delete XDG_PICTURES_DIR/Screenshots. (That’s pretty much the limit of my coding abilities.)

Serious question: What would it take for the adoption of an XDG_SCREENSHOTS_DIR? I was looking around yesterday to figure out what the XDG variables were and it looks like the organization is adaptable to new user requirements.

You can check this 2014 discussion thread on the XDG mailing list.

The issue is:

  • the location must be translatable
  • the location must be a sub-directory of another (translatable) directory

You need to modify the xdg-user-dirs tooling, and you need to modify the corresponding API in GLib (and other libraries); you need to have a drafted implementation and spec, and convince stakeholders across different environments to accept the change.

Thanks for the explanation.

Well, if this isn’t the appropriate way to initiate a feature request, please let me know, otherwise, consider it filed (in the circular file if that’s indeed the case, lol). A more straight forward method would still be preferable but as far as I’m concerned, I never have to deal with ~/pictures/Screenshots again so long as I’m using systemd.

$ cat /etc/systemd/user/ssmv.{path,service} /usr/local/sbin/ssmv.sh 
#ssmv.path
[Install]
WantedBy=paths.target
[Path] 
PathExists=%h/pictures/Screenshots
#PathChanged=$HOME/pictures/Screenshots



#ssmv.service
[Unit]
Description=Moves files from $HOME/pictures/Screenshots to $HOME/pictures/screenshots and deletes $HOME/pictures/Screenshots
Requires=

[Service]
Type=oneshot
# Set ExecStart to location of ssmv.sh script, e.g., /usr/local/sbin/ssmv.sh
ExecStart=/usr/local/sbin/ssmv.sh 

[Install]
Also=ssmv.path


#!/bin/bash
#ssmv.sh

# last edit: Thu Feb 16 09:25:20 AM EST 2023

scriptname="$(realpath $0)"

function editscript(){
if [[ "$1" == "edit" ]]; then
 (/usr/bin/nano "$scriptname")
 exit
fi
}

editscript "$1"

# defines the screenshot directories.  May eventually want to parse them from ~/.config/user-dirs.dirs:
watch="$HOME/pictures/Screenshots"
ssdir="$HOME/pictures/screenshots"

mv "$watch"/* "$ssdir/" && rmdir --ignore-fail-on-non-empty "$watch"

@iconoclasthero My thread that you quoted was actually a configuration issue as @jakedane said. I had the issue of ~/Screenshots, caz XDG_PICTURES_DIR wasn’t configured properly.

Admittedly a poor choice to site as an example. I’ve shown that many people for years have been looking for a solution to this.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.