Sparky Linux 7 Trying To Change the Default Directory for Screenshots [Solved]

Alexzee

Silver Member
Silver Supporter
Joined
Jun 1, 2019
Messages
5,156
Reaction score
3,181
Credits
33,107
I've been taking a lot of screenshots of my fresh installation of Sparky Linux 7 (based on Debian 12) in order to write a tutorial on this distro.:)

The system defaults to the Desktop for the screenshots I've taken.

I found the ~/.config for this to change it however I'm not sure what string I should add to the file.
This is the Mate DE.

Code:
@Debiansparky:~/.config$ cat ~/.config/user-dirs.dirs
# This file is written by xdg-user-dirs-update
# If you want to change or add directories, just edit the line you're
# interested in. All local changes will be retained on the next run.
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported.
#
XDG_DESKTOP_DIR="$HOME/Desktop"
XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_TEMPLATES_DIR="$HOME/Templates"
XDG_PUBLICSHARE_DIR="$HOME/Public"
XDG_DOCUMENTS_DIR="$HOME/Documents"
XDG_MUSIC_DIR="$HOME/Music"
XDG_PICTURES_DIR="$HOME/Pictures"
XDG_VIDEOS_DIR="$HOME/Videos"

I'm thinking that I would need to add this line to the config file so:
Code:
XGD_SCREENSHOTS_DIR="$HOME/SCREENSHOTS"

Am I right in this thinking?
 


I could just tell the screenshot app when it launches, the directory in which it needs to go, however, then I'm just doing more with the mouse. There has to be a way to make the default stick.

Hope everyone's weekend is going well.
 
Alex - not an xdg expert by any means, but I am thinking that you would first have to create $HOME/SCREENSHOTS before adding it to the config file.

All the other folders are standard pre-existing.

I am not sure you can even have $HOME/SCREENSHOTS , as the standards are set by freedesktop.org I think.

Is it PrtScrn you are using, or other?

Wiz
 
Alex - not an xdg expert by any means, but I am thinking that you would first have to create $HOME/SCREENSHOTS before adding it to the config file.

All the other folders are standard pre-existing.

I am not sure you can even have $HOME/SCREENSHOTS , as the standards are set by freedesktop.org I think.

Is it PrtScrn you are using, or other?

Wiz
No, not using PrtScrn. I'm using the Screenshot app from the Main Menu.

I made a directory within my /home directory and named it "Screenshot".

Perhaps I should look at the standards that were already set in freedesktop.org first before changing XGD config?
 
I'm thinking that I would need to add this line to the config file so:
XGD_SCREENSHOTS_DIR="$HOME/SCREENSHOTS"
Am I right in this thinking?

If you try that, it should read XDG not XGD.

However I have found two other methods that may appeal to you, one is CLI with

gsettings

and the other GUI, namely

dconf-editor

Sing out if you are interested, and I will expound on them.

I ran both with Linux 22.1 'Xia' MATE.

Wiz
 
If you try that, it should read XDG not XGD.

However I have found two other methods that may appeal to you, one is CLI with

gsettings

and the other GUI, namely

dconf-editor

Sing out if you are interested, and I will expound on them.

I ran both with Linux 22.1 'Xia' MATE.

Wiz

I had heard of the gsettings but not of dconf-editor.
Lot's of tasks on the To Do list today so I'll have to give this a spin sometime tomorrow.

Thanks for pointing out the misspelling mate.
Don't want to mis type that in the config.
 
With dconf-editor, it should be in the repos, that is

Code:
sudo apt install dconf-editor

I'll deal with gsettings first and with MATE first for the OP, but I'll also show the different syntax for Cinnamon and Xfce. None of it requires sudo.

It is a good idea to first set up your choice folder to save to, if you don't create one, they may just save to Desktop. For me, I create /home/chris/Pictures/myscreenies/

For MATE
  1. First run
    Code:
    gsettings get org.mate.screenshot last-save-directory
    - that may show another directory if you manually saved the last screenshot elsewhere
  2. Then run the instruction to save them to the new destination, in my case
    Code:
    gsettings set org.mate.screenshot last-save-directory 'file:///home/chris/Pictures/myscreenies'
  3. Check to see that the change took
    Code:
    gsettings get org.mate.screenshot last-save-directory
For Cinnamon, the same sort of procedure applies, but my command has a little additional input
Code:
gsettings get org.gnome.gnome-screenshot auto-save-directory
and
Code:
gsettings set org.gnome.gnome-screenshot auto-save-directory 'home/chris/Pictures/myscreenies'

XFCE

With xfce it works off a file in your ~/.config

To check the current settings

Code:
cat ~/.config/xfce4/xfce4-screenshooter | grep screenshot_dir

Open with

Code:
nano ~/.config/xfce4/xfce4-screenshooter

And I replace the entry screenshot_dir= with:

screenshot_dir=file:/home/chris/Pictures/myscreenies

I will cover a little of dconf-editor solutions on my tomorrow.

Cheers

Wizard
 
It looks like the screenshots are going where I need them to.
Code:
gsettings get org.mate.screenshot last-save-directory

'file:///home/alex/Screenshots'

So thank you for that. And, with XFCE I can use those instructions for my MX and Slackware install's.

I found dconf-editor in Synaptic.
 

Attachments

  • Dconfed.png
    Dconfed.png
    72.2 KB · Views: 185
Last edited:


Follow Linux.org

Staff online

Members online


Latest posts

Top