Skip to content

A tiny friend in your Mac's notch and on your iPhone that keeps an eye on your AI coding agents: Claude Code, Codex, Cursor, Gemini CLI, Antigravity and more. Approve from the notch or your Lock Screen.

Merge remote-tracking branch 'origin/main' into linux/spotify-dance

Claudea7c7ca6bdea1
diff --cc windows/README.md
index 4dba489b,b3a84723..bc618b3d
--- a/windows/README.md
+++ b/windows/README.md
@@@ -398,11 -404,13 +404,14 @@@ own window
console window (`cmd.exe` or PowerShell without Windows Terminal) has no such
ancestor — conhost owns that window — so its folder opens in VS Code instead,
as it does when `code` is on your `PATH` and nothing was found.
- - No global keyboard shortcuts yet: a waiting card is folded with its **⌃** or
- `Esc` in the island, and reopened by clicking the island or Open in the tray.
+ - Global keyboard shortcuts are hot keys on Windows, key grabs on Linux under
+ X11, and go through the desktop's GlobalShortcuts portal under Wayland (see
+ [Linux](#linux)). A waiting card is also folded with its **⌃** or `Esc` in
+ the island, and reopened by clicking the island, Open in the tray or **Go to
+ alert**.
- Apple Music, the one pill from the Mac catalog with nothing behind it here,
- is left out.
+ is left out. Spotify is on Linux only (see [Linux](#linux)): Windows has
+ nothing to read it from yet.
- Not in this version: sending a dropped file by email and dragging Mochi onto
a window to attach it as context. On the Mac, email goes through Resend or
Apple Mail's scripting; neither has a safe equivalent that attaches a file
@@@ -463,11 -473,8 +474,10 @@@
without a restart (the Mac's **Restart Coucou** isn't needed). Arabic turns
the island's text right to left but not its layout: Mochi and the pills keep
their sides.
-- Mochi on the desktop doesn't dance: there is no music integration to dance
- to, and dropping him on a window doesn't attach it to the chat. While he
+- Mochi on the desktop dances only on Linux, to Spotify; on Windows there is
+ no music integration to dance to yet. While he dances he stays awake (the
+ Mac lets him doze off mid-dance). Dropping him on a window doesn't attach it
- to the chat, and the Mac's
- ⌃⌥D shortcut isn't there — drag him out, double-click him home. While he
++ to the chat. While he
sleeps, the transparent square around him (120 px) takes the first mouse
move, which wakes him and gives the rest back to the desktop.
@@@ -524,32 -532,32 +535,46 @@@ What changes on Linux
for `sh`, and its config under `~` (see Supported agents). A config that is a
symlink (dotfiles) is written through to its target, with its permissions
kept.
- - **Global shortcuts** are X11 key grabs, so they work in an X11 session.
+ - **Global shortcuts** are X11 key grabs in an X11 session.
On X11, AltGr is a modifier of its own and never clashes with `Ctrl+Alt`;
combinations the desktop already uses (GNOME's `Ctrl+Alt+T` terminal and
- `Ctrl+Alt+←`/`→` workspace switching) show up as *In use*. Wayland has no
- key grabs — the GlobalShortcuts portal isn't supported yet — so nothing is
- registered there, and **Settings → Shortcuts** lists commands to bind in your
- desktop's own keyboard settings instead:
+ `Ctrl+Alt+←`/`→` workspace switching) show up as *In use*.
+ Wayland has no key grabs, so there Coucou hands its shortcuts to the desktop
+ through the XDG **GlobalShortcuts portal** (`xdg-desktop-portal`, with a
+ backend that has it: KDE Plasma 6, GNOME 48+, Hyprland, COSMIC…). Each
+ shortcut goes with its description and your keys as the preferred trigger;
+ the desktop may show its own window to confirm them or to pick other keys,
+ and it has the last word: a shortcut it already knows keeps the keys it was
+ given there, and you change them in the desktop's own shortcut settings.
+ **Settings → Shortcuts** says the shortcuts are registered with the desktop,
+ shows next to each one the keys the desktop reports (*Desktop: …*), and flags
+ one it left out. Changing or turning off a shortcut in Coucou binds the new
+ set in a new portal session. Coucou names itself `fr.louisraille.coucou` to
+ the portal where the portal allows it (`xdg-desktop-portal` 1.19+); a
+ desktop that wants an app name may otherwise refuse.
+ Where there is no such portal, or the desktop refuses, nothing is registered
+ and **Settings → Shortcuts** lists commands to bind in your
+ desktop's own keyboard settings instead (they are shown with the portal too,
+ for any shortcut that doesn't work):
`coucou --shortcut openChat` (or the AppImage's path) runs the action in the
Coucou that is already open. The ids are `toggleIsland`, `openChat`,
- `goToAlert`, `jumpToTerminal`, `nextPill`, `prevPill`, `muteToggle` and
- `wardrobeToggle`.
+ `goToAlert`, `jumpToTerminal`, `nextPill`, `prevPill`, `muteToggle`,
+ `desktopToggle` and `wardrobeToggle`.
- **Keys** live in the Secret Service (GNOME Keyring, KWallet).
+- **Spotify** (Settings → Integrations) is read over MPRIS, Spotify's D-Bus
+ interface on the session bus: the pill shows the track and plays, pauses
+ or skips on hover, the card has the cover, the progress bar (drag to
+ seek), shuffle, previous, next, repeat and the volume, and Mochi dances
+ while it plays — in the compact island, on the Spotify card, on the pill
+ and on the desktop. Nothing is polled: one thread waits on the bus for
+ Spotify's own signals while the pill is declared, and stops when it isn't.
+ **Open Spotify** brings it forward or starts `spotify` from your `PATH`,
+ else the Flatpak (`com.spotify.Client`) or the Snap; without one, **Get
+ Spotify** opens its download page. Covers come from Spotify's image CDN
+ (or a local track's file) and are fetched by Coucou itself, not the page.
+ Spotify builds that don't report the position over MPRIS show the bar
+ from where the track started; the Mac's Automation prompt has no
+ equivalent here.
- **Plan usage**: the status line relay is `~/.local/share/coucou/bin/coucou-hook
--statusline` and runs your previous status line with `/bin/sh -c`, like Claude
Code. Codex is found on `$PATH`, in `~/.local/bin`, npm's global prefix, Volta,
diff --cc windows/src-tauri/Cargo.toml
index 7beea0e5,b7dee25a..4eb649b1
--- a/windows/src-tauri/Cargo.toml
+++ b/windows/src-tauri/Cargo.toml
@@@ -50,6 -50,6 +50,7 @@@ libc = "0.2
# The GTK that Tauri already runs on, to reach its window for layer-shell and
# the input region. libgtk-layer-shell itself is called directly (platform/linux.rs).
gtk = "0.18"
- # The Spotify pill talks MPRIS on the session bus (spotify.rs). libdbus, the
- # version keyring already pulls in, so nothing new is downloaded.
-# Global shortcuts on Wayland through the XDG GlobalShortcuts portal
-# (portal.rs). The libdbus binding keyring's Secret Service already links.
-dbus = "0.9"
++# libdbus, which keyring's Secret Service already links, so nothing new is
++# downloaded: Wayland global shortcuts through the XDG GlobalShortcuts portal
++# (portal.rs) and the Spotify pill over MPRIS (spotify.rs).
+dbus = "0.9.12"
diff --cc windows/src-tauri/src/lib.rs
index 162099fd,eb59ee36..76e8b7f9
--- a/windows/src-tauri/src/lib.rs
+++ b/windows/src-tauri/src/lib.rs
@@@ -25,7 -27,7 +27,8 @@@ mod secrets
mod session_window;
mod settings;
mod shortcuts;
+ mod sounds;
+mod spotify;
mod tray;
#[cfg(windows)]
mod webview_drop;
@@@ -712,10 -713,10 +715,14 @@@ pub fn run()
desktop::desktop_mochi_fly_out,
desktop::desktop_mochi_fly_home,
desktop::desktop_mochi_set_asleep,
+ sounds::custom_sounds,
+ sounds::custom_sound,
+ sounds::reveal_sounds_folder,
+ sounds::reload_sounds,
+ spotify::spotify_refresh,
+ spotify::spotify_control,
+ spotify::spotify_open,
+ spotify::spotify_installed,
])
.setup(move |app| {
let handle = app.handle().clone();
diff --cc windows/src/core/bridge.ts
index 02e04f64,d863f96e..f8f0602a
--- a/windows/src/core/bridge.ts
+++ b/windows/src/core/bridge.ts
@@@ -201,28 -209,18 +210,31 @@@ export const Bridge =
desktopFlyHome: (forget: boolean) => call<boolean>("desktop_mochi_fly_home", { forget }),
/** Asleep, the cursor poll stops. */
desktopSetAsleep: (asleep: boolean) => call<void>("desktop_mochi_set_asleep", { asleep }),
+
+ // ── Spotify (src-tauri/src/spotify.rs, Linux) ─────────────────────────────
+ /** Reads the player again (the card came on screen) and reports it. */
+ spotifyRefresh: () => call<SpotifyState | null>("spotify_refresh"),
+ /** True when Spotify took it. `value`: seconds for seek, 0/1 for shuffle and repeat, 0…100 for volume. */
+ spotifyControl: (action: SpotifyAction, value?: number) =>
+ call<boolean>("spotify_control", { action, value: value ?? null }),
+ /** Brings Spotify forward or starts it; without it, its download page. */
+ spotifyOpen: () => call<boolean>("spotify_open"),
+ /** Whether there is a Spotify to launch (Settings). */
+ spotifyInstalled: () => call<boolean>("spotify_installed"),
};
+export type SpotifyAction = "playPause" | "next" | "previous" | "seek" | "shuffle" | "repeat" | "volume";
+
export type ShortcutStatus =
| "active" | "off" | "inUse" | "duplicate" | "invalid"
- | "typesCharacter" | "unsupported" | "notPorted";
+ | "typesCharacter" | "unsupported" | "notPorted"
+ /** Wayland: handed to the desktop's portal, no answer yet / left out by it. */
+ | "pending" | "refused";
export interface ShortcutsReport {
- actions: { id: string; status: ShortcutStatus; typed?: string }[];
- /** "wayland" or "no-display" when no global shortcut can be registered. */
+ /** `trigger`: on Wayland, the keys the desktop says run it, in its words. */
+ actions: { id: string; status: ShortcutStatus; typed?: string; trigger?: string }[];
+ /** "wayland" or "no-display" when no key grab can be made. */
blocked: string | null;
/** `<executable> --shortcut`: append an action id for a desktop shortcut. */
command: string;
diff --cc windows/src/views/views.ts
index 0da43d7d,da34eca7..9a40ae01
--- a/windows/src/views/views.ts
+++ b/windows/src/views/views.ts
@@@ -20,10 -21,9 +21,11 @@@ import { lastTextStep } from "../core/d
import { Bridge } from "../core/bridge";
import { buildRecap } from "./recap";
import { buildWardrobe } from "./wardrobe";
+import { buildSpotifyCard, buildSpotifyPill, type SpotifyPillHost } from "./spotify";
+import { SPOTIFY_ID } from "../core/spotify";
import type { Outfit, OutfitSelection } from "../mochi/wardrobe";
import { language, t, tl, type Msg } from "../i18n/i18n";
+ import type { ViewCommand } from "../island/shortcuts";
export interface ViewActions {
setView(v: IslandViewName): void;
@@@ -204,8 -202,10 +208,10 @@@ function buildOverview(actions: ViewAct
let pillIds = "";
let detailOpen = false;
let lastFocus: string | null = null;
- let mode: "ticker" | "card" | "plan" | "diff" | null = null;
+ let mode: "ticker" | "card" | "plan" | "diff" | "spotify" | null = null;
let cardKey = "";
+ /** The list row highlighted at the last sync, to scroll only when it moves. */
+ let shownSelection: number | null = null;
// Leaving the overview or folding the island closes the diff, as on macOS.
State.subscribe(() => {