diff options
| author | Danilo M. <danix@danix.xyz> | 2026-10-23 19:50:40 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-10-23 19:50:40 +0200 |
| commit | 923c0563f0389c4011c99b93a3edcfb09f5f3309 (patch) | |
| tree | 47a82512016b4d97ac48e81c74182d8d1defd0c3 /desktop/companion/test_mood.js | |
| parent | 540aa76b6088025dfca284a731002cec6b6c607c (diff) | |
| download | quickshell-923c0563f0389c4011c99b93a3edcfb09f5f3309.tar.gz quickshell-923c0563f0389c4011c99b93a3edcfb09f5f3309.zip | |
companion: sing when the Sony headphones connect
She now reacts to the headphones connecting with a short singing pose:
eyes shut, blindfold gone, mouth wide open, headphones on, a few musical
notes. The frames are new klein edits in frames.txt (dress/sing from
dress/base, leotard/sing from dress/sing), so a post-self-destruct sing
has its own art.
Detection is the island's rule (StatusPill.qml): by model prefix, since
BlueZ gives no class that says "headphones". The device's BlueZ Name is
WH-CH720N, which the alias does not affect. The reaction is a one-shot
hold in Mood.js (singHold, 4 s), placed after wave like the other event
reactions. A 4 s startup grace keeps a shell start with the headphones
already on from counting as a connection, since Bluetooth reads empty
for about 2 s.
Diffstat (limited to 'desktop/companion/test_mood.js')
| -rw-r--r-- | desktop/companion/test_mood.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/desktop/companion/test_mood.js b/desktop/companion/test_mood.js index 105648c..1331f70 100644 --- a/desktop/companion/test_mood.js +++ b/desktop/companion/test_mood.js @@ -28,7 +28,7 @@ const NOW = 10000000; // A snapshot with nothing going on, overridden per case. const calm = over => Object.assign({ leaving: false, now: NOW, destructAt: 0, dodging: false, shoved: false, shovedAt: 0, recording: false, busy: false, - repliedAt: 0, clicks: { count: 0, at: 0 }, mockAt: 0, typingAt: 0, wakeAt: 0, admireAt: 0, + repliedAt: 0, clicks: { count: 0, at: 0 }, mockAt: 0, typingAt: 0, wakeAt: 0, admireAt: 0, singAt: 0, monologue: false, idle: 0, }, over); const state = over => M.pick(calm(over)).state; @@ -48,6 +48,7 @@ const ladder = [ ["listen", { recording: true }], ["think", { busy: true }], ["wave", { repliedAt: NOW - 10 }], + ["sing", { singAt: NOW - 10 }], ["clicks", { clicks: { count: 2, at: NOW - 10 } }], ["admire", { admireAt: NOW - 10 }], ["mock", { mockAt: NOW - 10 }], @@ -79,6 +80,7 @@ assert.deepStrictEqual(M.pick(calm({ idle: 3 })), { state: "lying", frame: "lyin // Holds end on time. assert.strictEqual(state({ repliedAt: NOW - M.T.waveHold }), "base"); +assert.strictEqual(state({ singAt: NOW - M.T.singHold }), "base"); assert.strictEqual(state({ typingAt: NOW - M.T.typingHold }), "base"); assert.strictEqual(state({ wakeAt: NOW - M.T.wakeHold }), "base"); assert.strictEqual(state({ clicks: { count: 3, at: NOW - M.T.clickHold } }), "base"); |
