diff options
| author | Danilo M. <danix@danix.xyz> | 2026-11-12 11:10:56 +0100 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-11-12 11:10:56 +0100 |
| commit | 13f04c0d3188f9f974986225486c01f91cd18701 (patch) | |
| tree | 3736c597a92f7f357c38db6912742e376282b6f4 /desktop/assistant/Assistant.qml | |
| parent | 20dca0e8a84ba5e12caf06cac2c8aa6079daf615 (diff) | |
| download | quickshell-13f04c0d3188f9f974986225486c01f91cd18701.tar.gz quickshell-13f04c0d3188f9f974986225486c01f91cd18701.zip | |
feat(assistant): deck-it's chat look on the canvas
The canvas takes the deck-it Assistant tab's look: the backdrop picture
faded in behind the chat through a soft elliptic mask (stronger while the
chat is empty), and chat bubbles, the question on the right in an accent
bubble with the user's avatar, the reply on the left with the assistant's
face cropped from the backdrop. Thinking, tool chips and errors sit in the
reply bubble; three dots bounce while it has no words yet.
The pictures come from deck-it's config ([assistant] background,
user_avatar, face), read once at startup with the system python3, so
both follow one setting. MultiEffect's mask needs maskSpreadAtMin for a
gradient to fade; the default thresholds cut it to a hard oval.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'desktop/assistant/Assistant.qml')
| -rw-r--r-- | desktop/assistant/Assistant.qml | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/desktop/assistant/Assistant.qml b/desktop/assistant/Assistant.qml index a4fda72..d6863a0 100644 --- a/desktop/assistant/Assistant.qml +++ b/desktop/assistant/Assistant.qml @@ -293,6 +293,40 @@ Scope { } } + // deck-it's Assistant tab look, from its config's [assistant] keys: the + // backdrop picture, the user's avatar, and where the assistant's face is + // in the backdrop ([centre x, centre y, size] in its pixels). Empty: no + // backdrop, plain circles. + // ponytail: read once at startup; a qs restart picks up a config edit. + property string backdrop: "" + property string avatar: "" + property var face: [] + function fileUrl(p) { return p ? "file://" + p.split("/").map(encodeURIComponent).join("/") : ""; } + + Process { + running: true + command: ["/usr/bin/python3", "-c", ` +import json, os, tomllib +p = os.path.join(os.environ.get("XDG_CONFIG_HOME") or os.path.expanduser("~/.config"), "deck-it", "config.toml") +try: + a = tomllib.load(open(p, "rb")).get("assistant", {}) +except (OSError, tomllib.TOMLDecodeError): + a = {} +f = a.get("face") +ok = isinstance(f, list) and len(f) == 3 and all(isinstance(v, (int, float)) for v in f) +print(json.dumps({"bg": os.path.expanduser(a.get("background") or ""), + "avatar": os.path.expanduser(a.get("user_avatar") or ""), + "face": f if ok else []}))`] + stdout: StdioCollector { + onStreamFinished: { + try { + const c = JSON.parse(text); + root.backdrop = c.bg; root.avatar = c.avatar; root.face = c.face; + } catch (e) {} + } + } + } + // A file whose name says nothing (a script with no suffix) is "other" // until file(1) has read it. One run for all of them; the daemon makes // its own call on the content when the question is sent. |
