Disable auto-save screenshots

how to disable auto-save screenshots to images folder when I press print screen?

You are on Gnome and you are using the built-in tool?
Looks like the functionality does not exist, see GNOME 42: Missing "Save to clipboard" (only) functionality (#5208) · Issues · GNOME / gnome-shell · GitLab

One option that was mentioned in the issue is to use gnome-screenshot instead and map your key binding (PrtScr or Shift+PrtScr) to gnome-screenshot -ca.

Yeah on gnome, it’s sad because I don’t want to constantly go in and clean this folder, is it possible to automate this process? So that everything from this folder is cleared once at some time?

try the solution suggested in GNOME 42: Missing "Save to clipboard" (only) functionality (#5208) · Issues · GNOME / gnome-shell · GitLab (sending files to trash)

1 Like

Added f40, gnome, screenshot

Do I understand correctly that I should create a hotkey “prnt scrn” and enter this code there ln -s /dev/null ~/Screenshots or ln -s /dev/null ~/Pictures/Screenshots?

the idea is to …

  1. set PrtScr as hotkey for the screenshot tool, then
  2. create a symbolic link to a directory, namely you link your screenshot directory (~/Pictures/Screenshots) to /dev/null:
    ln -s /dev/null ~/Pictures/Screenshots
    What is /dev/null? Think of it as a black hole. Any data written there is discarded and not stored anywhere. So you basically “redirect” anything from “Screenshots” to /dev/null.

Be aware that you need to adapt the name of your screenshot folder to your language.

1 Like

the NULL file was copied as a symbolic link into the picture catalog
ln -s /dev/null /home/user/Pictures/ and
i renamed file “NULL” into “screenshots” it seemed to work!
thank you very much!

that seems dangerous since it will redirect anything in /home/user/Pictures in to nirvana… better only symlink the Screenshot directory.

1 Like

it didn’t work out with my catalog perhaps I entered the command differently or perhaps the terminal swore for 2 words through a space (since the word screenshot in our language is 2 words)

If you include the path name within single quotes such as
'/home/user/Pictures/Screenshots' the system will then treat the space as an actual character and should properly create that symlink.

Yeah. Write a script and add it to your crontab.

You can use the tmpwatch command for this.

1 Like

Hey guys! I’m only 4 days into this system! I’m not as smart as you! But I try! :slight_smile: I could use more detailed answers! If this is a script, what kind and where to insert it!?)

Crontab is short for “Cron Table”. Every user has their own. You enter a time interval in cron format followed by the command you want it to run. Then at those intervals it will run that command for you.

I haven’t used tmpwatch so I can’t speak to this, but here is an example of how an entry might look to clean the screenshots every hour at the top of the hour:

0 */1 * * * rm -f ${HOME}/Pictures/Screenshot_*.png
1 Like

Thank you! I’ll try it tomorrow at work and I still need to finish it, there will be a method with a symbolic link :slight_smile:

quotes worked! only with this command did he create a character link to the NULL file inside this directory

and if the command is written in a different order, then he writes that the file (/dev/null) does not exist
Снимок экрана от 2024-06-04 08-22-26

do I understand correctly that I need to fit this command into the terminal and everything will work?
tmpwatch --mtime --all 336 /home/user/Pictures/Screenshots

or will this script need to be autoloaded?

Running that in the terminal will activate it once. If you want it to happen on a schedule, you can use cron as @alys suggests. That would look something like this:

30 2 * * *  tmpwatch --mtime --all 336 ~/Pictures/Screenshots

Which will run the command at 30 minutes past the hour, when the hour is 2 (that is, 2am), on any day of the month, any month, and any day of the week. (That’s the * columns. man 5 crontab for more on the format.)

I’ve also used ~ instead of /home/user. In bash, and many tools like cron, that expands to the home directory of the current user. Very handy in many situations!

Also, depending on your system, the cron daemon (cronie by default) may not be installed or enabled.

sudo dnf install cronie
sudo systemctl enable crond --now

This is all a bit obscure because these are old-school Linux/Unix tool with, let’s say, a different mindset about ease-of-use. But they’re very flexible and powerful.

2 Likes

thank you very much to all participants for your help!

2 Likes