From 536332f61619026792cdd02f45469100ddd07b61 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 23 Oct 2026 15:59:32 +0200 Subject: companion: a remark for the program in front of her The focused window's class, from Hyprland's activewindow event, picks a line from Lines.js keyed app:. The event fires on every title change too, so she reacts only when the class changes, and a third of the time, under the existing 30 s line cooldown so alt-tabbing does not make her chatter. Classes come from the window rules in the live config; one without lines says nothing. Lines only, no frames of her own yet. Co-Authored-By: Claude Opus 5.5 --- desktop/companion/Companion.qml | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'desktop/companion/Companion.qml') diff --git a/desktop/companion/Companion.qml b/desktop/companion/Companion.qml index 12dd009..683eb4a 100644 --- a/desktop/companion/Companion.qml +++ b/desktop/companion/Companion.qml @@ -85,6 +85,7 @@ PanelWindow { property double lastLineAt: 0 property double lastMonologueAt: 0 property bool monologue: false + property string appClass: "" // Bored, yawning, lying down at 20, 40 and 70% of the wscreensavers idle // timeout, so she has lain down a while before the saver covers her (1, @@ -161,6 +162,15 @@ PanelWindow { // the keybind reminder. Map again, after it. root.remapping = true; remap.restart(); + } else if (event.name === "activewindow") { + // "class,title". A remark now and then when focus moves to a + // different program, under the usual 30 s line cooldown. + // ponytail: one line per class, no frames of her own; add + // per-app frames or title matching (a site in firefox) if + // lines alone feel thin. + const cls = event.data.split(",")[0].trim().toLowerCase(); + if (cls !== "" && cls !== root.appClass && Math.random() < 1 / 3) root.say("app:" + cls); + root.appClass = cls; } else if (["fullscreen", "activewindowv2", "workspacev2"].includes(event.name)) { Hyprland.refreshToplevels(); fsSettle.restart(); -- cgit v1.2.3