Configuration
Every flag has a config-file equivalent. Set your preferences once and keep your command lines short.
Where tsoqna looks#
| Platform | User config file |
|---|---|
| Linux, BSD | $XDG_CONFIG_HOME/tsoqna/config.toml (usually ~/.config/tsoqna/config.toml) |
| macOS | ~/Library/Application Support/tsoqna/config.toml |
| Windows | %APPDATA%\tsoqna\config.toml |
On top of that, any folder can carry its own .tsoqna.toml (since 1.3). When you run tsoqna on a source folder, it looks for that file in the folder and each of its parents, and the nearest one wins.
Precedence#
- Command-line flags
- Environment variables (
TSOQNA_PATTERN,TSOQNA_TZ, …) - The nearest
.tsoqna.toml - The user config file
- Built-in defaults
Not sure where a value is coming from? Ask:
$ tsoqna config show --origin
pattern = "{date}_{time}{ext}" # ~/.config/tsoqna/config.toml
folders = "{Y}/{Y}-{m}" # /home/ana/Photos/.tsoqna.toml
on_conflict = "suffix" # default
fallback = "skip" # default
timezone = "local" # TSOQNA_TZ
A typical config file#
# ~/.config/tsoqna/config.toml
pattern = "{date}_{time}{ext}"
folders = "{Y}/{Y}-{m}"
# What to do when two photos would get the same name.
on_conflict = "suffix" # suffix | skip | fail
# What to do with files that have no capture date.
fallback = "skip" # skip | mtime | filename
# Move .xmp/.aae/.thm files along with their photo.
sidecars = true
timezone = "local" # or an IANA name such as "America/Denver"
[filter]
include = ["*.jpg", "*.jpeg", "*.heic", "*.dng", "*.cr3", "*.nef", "*.arw", "*.raf", "*.mov", "*.mp4"]
exclude = ["**/.thumbnails/**", "**/@eaDir/**"]
[journal]
enabled = true
keep = 20 # how many past runs undo can see
All keys#
| Key | Default | Flag | Notes |
|---|---|---|---|
pattern | "{date}_{time}{ext}" | -p | File name template. |
folders | "{Y}/{Y}-{m}" | --folders | Folder template, used by sort only. |
on_conflict | "suffix" | --on-conflict | tsoqna never overwrites, whatever this is set to. |
fallback | "skip" | --fallback | For files with no usable date. |
sidecars | true | --no-sidecars | Matches by stem, case-insensitively. |
timezone | "local" | --tz | Applied only where the file has no offset of its own. |
shift | "0" | --shift | Fix a camera clock, e.g. "+1h" or "-00:07:30". (since 1.3) |
mode | "move" | --copy | sort only: move or copy. |
jobs | number of cores | -j | Metadata is read in parallel; moves are always sequential. |
dry_run | false | -n | Set to true if you want tsoqna to be cautious by default; pass --no-dry-run to really do it. |
Folder-level .tsoqna.toml files are read from the source side. A config file sitting in the destination is ignored, so a shared photo library cannot silently change how you sort your own imports.