mirror of
https://github.com/edu4rdshl/Strata.git
synced 2026-07-17 23:24:46 +00:00
Two changes for 0.7.0: BREAKING (D-Bus): the service is renamed from org.gnome.Strata to dev.edu4rdshl.Strata. The org.gnome.* namespace is reserved for official GNOME software; Strata is third-party, so it now uses the reverse-DNS of its own domain (matching the strata@edu4rdshl.dev UUID). Bus name, object path (/dev/edu4rdshl/Strata), and interface (dev.edu4rdshl.Strata.Manager) all change. Daemon and extension are updated together; only external busctl scripts / non-GNOME front-ends that hard-coded the old name need updating. The GSettings schema (org.gnome.shell.extensions.strata) is unchanged - that namespace is correct for GNOME Shell extension settings. Fix recursion: the theme-context 'changed' handler reloaded light.css, but load_stylesheet itself emits 'changed', so it fed back into itself and hit "too much recursion" - flooding the journal and spinning the CPU on screen unlock (which restyles widgets and fires 'changed'). The subscription is removed; light.css is loaded once. Dark/light switching is unaffected (it is the panel's class toggle, not this load). A GNOME Shell theme switch no longer auto-re-applies the sheet, which is recoverable by re-enabling. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
3.3 KiB
3.3 KiB
strata-daemon
The Rust backend for Strata. Speaks D-Bus, stores history in SQLite, generates image thumbnails, and indexes text for full-text search.
It is not GNOME-specific. Any D-Bus client can use it.
Build
cargo build --release
# binary at target/release/strata-daemon
The GNOME extension spawns this binary automatically; you only need to run it manually if you're using a non-GNOME front-end.
Storage
| Path | Contents |
|---|---|
~/.local/share/strata/clipboard.db |
History DB (WAL mode, FTS5 index) |
~/.cache/strata/thumbnails/<id>.png |
Per-item image thumbnails |
D-Bus interface
- Bus name:
dev.edu4rdshl.Strata - Object path:
/dev/edu4rdshl/Strata - Interface:
dev.edu4rdshl.Strata.Manager
| Member | Signature | Notes |
|---|---|---|
SubmitItem (method) |
(s ay) → () |
Ingest a clipboard payload (mime, raw bytes) |
GetHistory (method) |
(u u) → s |
(offset, limit) → JSON array |
SearchHistory (method) |
(s u) → s |
FTS5 query → JSON array |
GetThumbnail (method) |
s → ay |
PNG bytes for item id |
GetItemContent (method) |
s → (ss) |
(mime, base64) for paste-back |
SetClipboard (method) |
s → () |
Re-copy a stored item |
DeleteItem (method) |
s → () |
|
ClearHistory (method) |
() → () |
|
Shutdown (method) |
() → () |
Graceful exit |
SetConfig (method) |
(uuu) → () |
(max_history, max_text_bytes, max_image_bytes); 0 means leave unchanged |
ItemAdded (signal) |
(sss) |
(id, mime, preview) |
ItemDeleted (signal) |
s |
|
HistoryCleared (signal) |
() |
Example: drive it from the shell
# Start the daemon (foreground)
./target/release/strata-daemon
# In another terminal:
busctl --user call dev.edu4rdshl.Strata /dev/edu4rdshl/Strata \
dev.edu4rdshl.Strata.Manager GetHistory uu 0 10
# Submit text:
busctl --user call dev.edu4rdshl.Strata /dev/edu4rdshl/Strata \
dev.edu4rdshl.Strata.Manager SubmitItem say "text/plain;charset=utf-8" 5 104 101 108 108 111
# Listen for new items:
busctl --user monitor dev.edu4rdshl.Strata
Supported clipboard payloads
Strict mime allowlist. Per-type size caps default to 1 MB for text and
5 MB for images; both are runtime-configurable via the SetConfig
D-Bus method (the GNOME extension wires this to its GSettings).
- Text:
text/plain*,UTF8_STRING,STRING,TEXT,text/rtf,text/markdown,text/html,text/uri-list,x-special/nautilus-clipboard,application/x-kde-cutselection,application/rtf - Images:
image/png,image/jpeg,image/jpg,image/gif,image/webp,image/bmp,image/tiff,image/avif,image/x-icon,image/svg+xml
Items carrying x-kde-passwordManagerHint are silently dropped
(KeePassXC / Bitwarden convention).
Module map
src/
├── main.rs Entry point, clipboard ingest, mime allowlist
├── config.rs Config loading + size caps
├── db.rs SQLite schema, FTS5, parameterised queries
├── dbus_service.rs zbus interface implementation
└── clipboard/
├── monitor.rs Optional wl-clipboard-rs monitor (unused on GNOME)
└── writer.rs Paste-back helpers
Tests
cargo test --release
License
GPL-3.0-or-later.