feat(gui,core,cli): edit excluded files, open-with rules and the launcher in Preferences (#99)

Preferences gains two pages for the config.json settings that had no
place in the app:

- Sync: the patterns every synced folder leaves out (own patterns, and
  each built-in one on or off), and what the conflict sweep may do.
- Apps: which program opens which kind of file (open_with), and how the
  search launcher opens (prompt).

Each synced folder kept on this computer gets "Excluded Files…" in its
menu for its own .pdfsignore: checked as typed, "Check a path" says
which rule decides, and a version changed elsewhere is never written
over without asking. `pdfs sync ignore list|add|remove|reset|check` does
the same from a terminal, and `--page preferences-sync` (and -apps,
-storage) opens Preferences at a page.

Every writer of config.json now goes through AppDirs::update_config,
which reads, changes and writes under an flock on config.json.lock, so
the app, the tray and the daemon no longer undo each other's change
(B292). The opener reads its rules on each open, so a new rule applies
without a restart.

The built-in ignore list also leaves out what Nextcloud, Dropbox and
Syncthing leave out: desktop.ini, .directory, trash folders, NFS/FUSE
leftovers, partial downloads, Kate swap and office lock files.
This commit is contained in:
nvrl committed 2026-11-15 23:03:58 +01:00
1 parent 14b9e0fe64
commit 0df4b3c5f9
40 files changed
+8376 -3303

No files matched your search

+16 -4
View File
@@ -16,7 +16,8 @@ Options:
--out DIR where the PNGs go (default: images/)
--only LIST capture only these, comma-separated (default: all of
login,files,photos,photos_map,computers,sync,conflicts,
prompt_gtk,prompt_fzf)
prompt_gtk,prompt_fzf). preferences_sync and
preferences_apps exist too, for pull requests only
--website DIR afterwards, copy them into the website checkout at DIR
with its scripts/sync-screenshots.sh
--settle SECS how long a page gets to load before its capture (default 3)
@@ -34,6 +35,8 @@ EOF
repo="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)"
all=login,files,photos,photos_map,computers,sync,conflicts,prompt_gtk,prompt_fzf
# Not in the README, so not taken by default.
extra=preferences_sync,preferences_apps
# The capture itself, run by cage inside the throwaway session (see below).
if [[ "${1:-}" == --capture ]]; then
@@ -66,7 +69,8 @@ if [[ "${1:-}" == --capture ]]; then
app=$!
sleep "$SETTLE"
for shot in files:browser photos:gallery photos_map:places-map computers:devices \
sync:sync-folders conflicts:activity; do
sync:sync-folders conflicts:activity \
preferences_sync:preferences-sync preferences_apps:preferences-apps; do
name=${shot%%:*}
wants "$name" || continue
"$BIN/pdfs-app" --page "${shot#*:}"
@@ -138,7 +142,7 @@ while (($#)); do
shift
done
for shot in ${shots//,/ }; do
[[ ",$all," == *",$shot,"* ]] || { echo "no screenshot called $shot" >&2; exit 2; }
[[ ",$all,$extra," == *",$shot,"* ]] || { echo "no screenshot called $shot" >&2; exit 2; }
done
for tool in cage grim wlr-randr magick dbus-run-session gnome-keyring-daemon cargo curl; do
command -v "$tool" >/dev/null || { echo "$tool is required" >&2; exit 2; }
@@ -185,7 +189,15 @@ cat >"$root/config/proton-drive-linux/config.json" <<'EOF'
"tray_hidden": true,
"update_check": false,
"online_map": false,
"files_view": { "list": false }
"files_view": { "list": false },
"ignore_patterns": [".git/", "node_modules/", "target/", "*~", "*.swp", ".DS_Store",
"*.iso", "build/", "*.sqlite-wal"],
"open_with": {
"rules": [
{ "match": ["@text", "*.md"], "command": ["nvim"], "terminal": true },
{ "match": ["@image"], "command": ["loupe"] }
]
}
}
EOF