Environments variables in Shotwell?

Does Shotwell use any environmental variables, e.g. for the option "--datadir=DIRECTORY" or the directory for the log? I can’t seem to find any in the docs…

You can use environment variables in --datadir=DIRECTORY but only when you’re invoking shotwell from a shell. E.g., from a terminal you can run shotwell --datadir=$HOME or similar. But if you put that command in a desktop launcher it won’t work. You’d have to use a command like bash -c 'shotwell --datadir=$HOME' in a desktop launcher to make it work the same.

You are right, this is mostly missing from the documentation. There might be the occasional mention in the Wiki. Also note: I would generally advise against the use of --datadir, it comes from a time in the past where everything was in that folder which is no longer the case, so your mileage may vary.


  • SHOTWELL_LOG=1 enables the debug logging
  • SHOTWELL_LOG_FILE=... sets the log file, where :console: will dump the log on the screen instead.
  • SHOTWELL_SOUP_LOG=1 will log the HTTP requests sent and received by the publishing plugins


In general, shotwell should respect all of the relevant XDG_... variables (see XDG Base Directory Specification)

Thank you for your answers!

I was hoping for a more specific way to direct Shotwell then using $XDG variables, something like

$SHW_DATA_HOME - SQlite3-database file
$SHW_CONFIG_HOME - Settings and such stuff
$SHW_CACHE_HOME - Thumbnail files

that can override $XDG_DATA_HOME et al. if set.

I guess I can put it on some wish-list or better see if I can contribute myself :smile:

What are you actually trying to achieve?

From time to time I upgrade my OS disk and/or move to newer releases. Although Shotwell has been stable in file placement I have chosen a solution where all my photos (actually used as ‘in place’) and tagging (stored in ‘photos.db’) are on a separate disk/filesystem. This filesystem is backed up to other disks and to the cloud. So I would like to direct Shotwell to store all its info on this filesystem/dir and not in subdirectories to my $HOME directory (which might be replaced/gone).

Ok, in this case setting the datadir is the correct way to do it. But you settings will only live in gsettings (backed by dconf) which will be in your home folder.

It’s OK that settings live in “gsettings”. It’s the thumbnails, paths, tags, events and filters I want to backup. What I was hoping (in the original question) was that there might be an alternative way to do it as opposed to using --datadir, e g using an environment variable set in “.bashrc”.

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