quick_search/config_example.toml

187 lines
10 KiB
TOML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# QuickSearch configuration reference.
#
# The live config is auto-created at ~/.config/quicksearch/config.toml
# (Windows: %APPDATA%\quicksearch\config.toml). A config.toml placed next
# to the quicksearch binary overrides it entirely (portable mode).
# Relative paths resolve against the directory containing the config
# file, so a portable folder can be moved wholesale.
#
# Every key is optional; missing keys take the defaults shown here.
[paths]
# One or more directory roots to index. Walked in order; duplicate and
# nested roots are de-duplicated automatically. `~` expands to home.
# Adding a folder reindexes to pick it up; removing one deletes its entries
# and leaves the rest of the index alone. Order and spelling do not matter:
# "~/docs", "/home/you/docs" and "/home/you/docs/" are one folder.
indexing_paths = ["~"]
# SQLite index location. Default: ~/.local/share/quicksearch/index.sqlite
# On Windows the default is %LOCALAPPDATA%\quicksearch\index.sqlite. Write
# Windows paths as TOML *literal* strings (single quotes) so the
# backslashes need no escaping, and keep the index out of a roaming
# profile — it is far too large to synchronise:
# database_path = 'C:\Users\you\AppData\Local\quicksearch\index.sqlite'
database_path = "~/.local/share/quicksearch/index.sqlite"
[indexing]
# The indexing mode. true = automatic: filesystem watchers apply changes a
# couple of seconds after they happen — the queue waits for a burst to settle
# so that deleting a folder costs one operation instead of one per file — and
# a full reindex runs every reindex_interval_minutes (the watcher catches
# changes as they happen, so that interval only needs to be
# often enough to cover whatever the watcher missed). false = manual:
# nothing is indexed until you ask for it. The Stop and Return to Automatic
# buttons on the Manage Index tab write this value, so the mode you left the
# app in is the mode it starts in.
auto_index = true
reindex_interval_minutes = 60
# Follow symbolic links during directory walks. Applies to links pointing at
# files as well as at directories: with this off a symlink is not resolved at
# all, so its target is never indexed — which matters because a target can
# live outside every folder listed above. A resolved target is stored under
# its own real path, not the link's. Turning this off removes the entries
# that are no longer in scope; turning it on reindexes to find them.
follow_symlinks = false
# Index hidden files and directories. That means dot-files everywhere, and
# additionally anything carrying the Hidden attribute on Windows (AppData,
# $RECYCLE.BIN, System Volume Information, pagefile.sys ...). The System
# attribute on its own does not count: Windows honours the desktop.ini inside
# a folder only if the folder carries System or Read-only, so cloud sync roots
# (ownCloud, Nextcloud, OneDrive, Google Drive) and any folder given a custom
# icon carry it purely to get that icon, and are indexed normally.
# Turning this off removes the hidden entries already indexed.
include_hidden = false
# Empty = extract text from every supported format. Non-empty = content
# indexing only for these extensions; other files are still listed for
# filename search. Entries are case-insensitive, leading dot optional.
# The reserved entry "(none)" whitelists files that have no extension at
# all (Makefile, README, .bashrc); a non-empty list without it skips them.
# Inside an entry, "#" starts a comment that runs to its end, so entries may
# be annotated or commented out:
# content_extensions = ["txt", "md # docs", "# pdf — too slow", "(none)"]
# Narrowing this drops the stored text of the files it now excludes, leaving
# them findable by name; widening it reindexes to extract the ones it now
# allows. Order, case, a leading dot and comments make no difference.
content_extensions = []
# Excluded from the index entirely. A pattern without a separator matches
# any single path component (so ".git" prunes whole subtrees); patterns
# containing one match full paths, including a bare drive root like 'D:\'.
# Glob syntax (*, ?, [..]). A name pattern must match the whole name:
# ".jpg" only matches something named exactly ".jpg" — ignoring an
# extension needs the wildcard, "*.jpg". Matching is case-insensitive on
# Windows and macOS, case-sensitive elsewhere, following the filesystem.
#
# The Windows defaults add: "$RECYCLE.BIN", "System Volume Information",
# "pagefile.sys", "hiberfil.sys", "swapfile.sys", "Thumbs.db",
# "desktop.ini".
ignore_patterns = [".git", "node_modules", "*.tmp", ".venv", "venv"]
# Worth adding by hand if you index a whole Windows drive rather than just
# your profile. Neither is excluded by default, because the default root
# is your profile and a bare "Windows" pattern would also match a folder
# of your own with that name:
# 'C:\Windows' — system files, nothing you would search for
# 'C:\Windows\WinSxS' — a hardlink farm that floods the Duplicates tab
# Walker threads per root, keyed by the exact root string from
# indexing_paths. Absent or 0 = auto (4 on local storage, 16 on network
# mounts, detected per root). Applies at the start of the next run.
# root_workers = { "/media/share" = 24 }
[processing]
# Bytes read from the start of each file for its content hash, which is
# `sha256(size || first hash_length bytes)` and backs duplicate detection.
# Only the head is read: seeking to the end for a second block costs an
# extra round trip per file on network shares. The same bytes are also the
# detection window that decides what a file is: magic-byte matching, and
# the text sniff that lets extensionless or unknown-extension files be
# indexed as text — so shrinking this judges files on less evidence.
#
# Known limitation: files of identical size whose heads match will be
# reported as duplicates. In practice that means pre-allocated VM disk
# images: a fixed-size VHD stores its unique footer at the end of the
# file, and a freshly pre-allocated raw/qcow2/VMDK image is all zeros at
# the head until it is partitioned.
hash_length = 8192
# Maximum extracted text stored per file (bytes).
maximum_text_size = 262144
# Files larger than this skip text extraction entirely (bytes).
maximum_text_file_size = 2097152
# Files per batch during walks / inserts / extraction.
batch_size = 500
# Files per transaction for incremental FTS updates.
fts_update_batch_size = 1000
# How large the write-ahead log (index.sqlite-wal) may grow during an
# indexing run before the indexer forces a checkpoint (bytes). SQLite copies
# the log into the index on its own but can only reset it when no reader is
# mid-query, and a run keeps one reader per root busy throughout — so
# unattended the log grows for the whole run and can end up larger than the
# index. Set to 0 to disable forced checkpoints; any other value below
# 16777216 is raised to it.
maximum_wal_size = 536870912
# FTS5 tokenizer: 'trigram' (substring matching, the default; gets
# remove_diacritics 1 appended), 'unicode61', 'porter', or a full FTS5
# option string. See https://www.sqlite.org/fts5.html#tokenizers
tokenize = "trigram"
# Store extracted text (zstd-compressed) alongside the FTS index. Off:
# the index shrinks to roughly stock-Baloo size, but search loses snippet
# previews, occurrence ranking, case verification, and fuzzy full-text.
# Turning it off discards the stored text immediately; turning it on
# re-extracts, because the text of files already indexed was never kept.
store_text_for_snippets = true
[security]
# Encrypt the index with a password (SQLCipher). The password is asked
# for every time QuickSearch starts; turning this on or off deletes and
# rebuilds the index. Change it from the GUI (Options → Security), not by
# hand: enabling protection also generates the KDF salt below.
password_protected = false
# Store the derived key in the OS keychain (Secret Service / KWallet on
# Linux, Credential Manager on Windows) and skip the startup prompt.
use_keychain = false
# When a password is set, the app writes a `salt` value here (32 hex
# digits). It is not a secret, but it is unique to your index: do not
# create or edit it by hand, and keep it if you copy this file — the
# password only unlocks the index together with its salt.
[ui]
# Zoom factor for the whole GUI: fonts, spacing, and widgets scale
# together (0.5 2.5). Ctrl +/- and Ctrl 0 adjust it temporarily at
# runtime; this value is the persistent baseline.
scale = 1.1
# Written by QuickSearch, not by you: the folders that have already shown
# the "more subfolders than the watcher can follow" warning, so restarting
# does not repeat it. Keyed by folder rather than a single flag so that
# adding a folder warns again — the trade-off changed — and pruned to the
# current folder list whenever it is applied. Deleting it just means the
# warnings come back once each.
watch_cap_warned_roots = []
# System-wide shortcut that raises QuickSearch, switches to the Search tab
# and selects whatever is in the search box, from anywhere. Modifiers are
# Ctrl, Alt and Shift, joined to one key with "+". Leave it empty ("") for
# no shortcut. On Wayland this is only a preference: the shortcut is
# registered with your desktop, which may assign a different key and lets
# you change it in its own keyboard settings.
search_hotkey = "Ctrl+Shift+F"
# 'dark' or 'light'. Applied as soon as it is changed in the Options
# window. Your desktop's own light/dark setting is not consulted: reading
# it would mean connecting to your session's message bus and subscribing to
# your settings, which is more than a search tool should ask for. Anything
# other than 'light' is dark.
color_scheme = "dark"
[search]
# Start with the fuzzy passes enabled.
fuzzy_default = false
# Ceiling on the fuzzy stages' typo budget. The allowance grows with the
# search term, one edit per three characters, up to this value, so 2
# means "1 edit for 3-5 character terms, 2 for anything longer". 0 turns
# the fuzzy stages off. Above 3 is allowed but not recommended: matches
# become dominated by coincidence and every fuzzy pass slows down.
fuzzy_max_edits = 2
# Hard cap on results per search (the GUI's scroll list length).
display_limit = 1000
# Results per streamed batch (latency/overhead knob, not a page size).
results_per_page = 100
# How long the GUI waits after the last keystroke before searching (ms).
debounce_ms = 150