Viewer (svxiv)

svxiv is a high-speed, custom-CSS SVG and raster image viewer built on GTK3 + WebKit2GTK 2.50 inside photon_platform.clerk.viewer. It combines sxiv’s keyboard-driven ergonomics and UNIX stdin/stdout marking pipeline with full browser-grade CSS custom properties (var(--*)), CSS Selectors Level 4 (:where()), vector-effect: non-scaling-stroke, Shadow DOM isolation, and a virtualized thumbnail grid engineered for 50,000+ SVGs.

Installation

clerk remains importable without GTK bindings. To enable svxiv with PyGObject<3.52 (using the system gir1.2-gtk-3.0 and gir1.2-webkit2-4.0 typelibs):

uv tool install --editable "/home/phi/PROJECTS/photon-platform/clerk[viewer]"
        

Usage

svxiv [OPTIONS] [PATH ...]
        

Examples:

# Browse a Codex directory in virtualized thumbnail grid and emit marked paths
        svxiv -t -o docsrc/heath/volume_I/

        # Recursively inspect 53,000+ GEOMETOR ETC SVGs
        svxiv -t -r /home/phi/PROJECTS/geometor/etc/resources/centers/

        # Pipe file list from fd/rg via stdin
        fd -e svg | svxiv -i -t -o

        # Live-preview custom CSS edits (auto-reloads on save without losing zoom)
        svxiv --css custom.css --theme parchment 0003.g1.svg

        # Headless pixel-exact PNG render via WebKit2GTK get_snapshot()
        svxiv --render plate.png --width 1200 --theme dark 0003.g1.svg

        # Optional warm Unix-socket daemon (~30ms subsequent window launches)
        svxiv --daemon
        

CLI Options

  • -t, --thumbnail: Start in virtualized thumbnail grid mode.

  • -o, --output: Write marked file paths to stdout on quit.

  • -b, --no-bar: Hide the bottom status bar initially.

  • -f, --fullscreen: Launch fullscreen.

  • -n NUM, --start NUM: Start at 1-based item index NUM.

  • -r, --recursive: Recursively scan directories (skipping .git, .venv, __pycache__, node_modules, .doctrees).

  • -i, --stdin / -: Read newline-delimited paths from stdin.

  • --css PATH: Inject custom user CSS (repeatable; live-reloaded on save).

  • --theme {dark,light,parchment,print,checker}: Set initial viewport theme.

  • --profile {auto,publish,explorer,medallion,raw}: Set CSS profile cascade.

  • --daemon / --no-daemon: Run or bypass the warm daemon at /run/user/$UID/svxiv.sock.

  • --render OUT.PNG (--width, --height): Headless offscreen PNG snapshot.

Keyboard Controls

  • Enter: Toggle Single Canvas ↔ Virtualized Thumbnail Grid.

  • h / j / k / l: Navigate grid tiles, or pan zoomed canvas (h/l step prev/next when unzoomed).

  • Space / n and Backspace / p: Next / previous item (preloaded ring).

  • g / G / <N>g: First / last / jump to item #N.

  • m / M / u: Mark/unmark current / invert marks / unmark all.

  • Ctrl+n / Ctrl+p: Next / previous marked item.

  • + / - / = / w / W / e: Zoom in/out, 100%, fit window, fit width, fit height.

  • /: Live incremental fuzzy filter on filename and relative path.

  • t / T: Cycle viewport theme (dark / light / parchment / print / checker).

  • c / C: Cycle CSS profile (auto / publish / explorer / medallion / raw) / toggle repo custom.css.

  • o: Cycle .facsimile-img underlay opacity (100% → 40% → 0%).

  • L then 1–6 (0 resets): Toggle semantic SVG layers (#elements, #graphics, #points, #labels, #highlights, .facsimile-img).

  • d: Toggle live data-ref / coordinate hover inspection HUD.

  • s: Cycle Split Compare (Off → SVG | Paired PNG → Dark | Light → Current | Marked).

  • v: Toggle viewBox bounding wireframe and coordinate grid.

  • f / b / r: Fullscreen / status bar / reload item and CSS from disk.

  • Ctrl+x <key>: Execute ~/.config/svxiv/exec/key-handler (fallback ~/.config/sxiv/exec/key-handler).

  • P: Pin marked (or current) items to ~/.local/state/clerk/focus.json.

  • q: Quit (emitting marked paths to stdout when -o is set).