Notifikationer
imux understøtter desktopnotifikationer, der giver AI-agenter og scripts mulighed for at advare dig når de har brug for opmærksomhed.
Livscyklus
- Modtaget: notifikation vises i panelet, desktopalert udløses (hvis ikke undertrykt)
- Ulæst: badge vises på workspace-fanen
- Læst: ryddes når du ser det workspace
- Ryddet: fjernet fra panelet
Undertrykkelse
Desktopalarmer undertrykkes når:
- icc-vinduet er fokuseret
- Det specifikke workspace der sender notifikationen er aktivt
- Notifikationspanelet er åbent
Notifikationspanel
Tryk ⌘⇧I for at åbne notifikationspanelet. Klik på en notifikation for at springe til det workspace. Tryk ⌘⇧U for at springe direkte til workspace med den seneste ulæste notifikation.
Brugerdefineret kommando
Kør en shell-kommando hver gang en notifikation planlægges. Indstil det i Indstillinger > App > Notifikationskommando. Kommandoen kører via /bin/sh -c med disse miljøvariabler:
| Variabel | Beskrivelse |
|---|---|
ICC_NOTIFICATION_TITLE | Notifikationstitel (workspace-navn eller appnavn) |
ICC_NOTIFICATION_SUBTITLE | Notifikationsundertitel |
ICC_NOTIFICATION_BODY | Notifikationstekst |
# Text-to-speech
say "$ICC_NOTIFICATION_TITLE"
# Custom sound file
afplay /path/to/sound.aiff
# Log to file
echo "$ICC_NOTIFICATION_TITLE: $ICC_NOTIFICATION_BODY" >> ~/notifications.logKommandoen kører uafhængigt af systemlydvælgeren. Sæt vælgeren til "Ingen" for kun at bruge den brugerdefinerede kommando, eller behold begge for en systemlyd plus en brugerdefineret handling.
Afsendelse af notifikationer
CLI
icc notify --title "Task Complete" --body "Your build finished"
icc notify --title "Claude Code" --subtitle "Waiting" --body "Agent needs input"OSC 777 (simpel)
RXVT-protokollen bruger et fast format med titel og brødtekst:
printf '\e]777;notify;My Title;Message body here\a'notify_osc777() {
local title="$1"
local body="$2"
printf '\e]777;notify;%s;%s\a' "$title" "$body"
}
notify_osc777 "Build Complete" "All tests passed"OSC 99 (avanceret)
Kitty-protokollen understøtter undertitler og notifikations-ID'er:
# Format: ESC ] 99 ; <params> ; <payload> ESC \
# Simple notification
printf '\e]99;i=1;e=1;d=0:Hello World\e\\'
# With title, subtitle, and body
printf '\e]99;i=1;e=1;d=0;p=title:Build Complete\e\\'
printf '\e]99;i=1;e=1;d=0;p=subtitle:Project X\e\\'
printf '\e]99;i=1;e=1;d=1;p=body:All tests passed\e\\'| Funktion | OSC 99 | OSC 777 |
|---|---|---|
| Titel + tekst | Ja | Ja |
| Undertitel | Ja | Nej |
| Notifikations-ID | Ja | Nej |
| Kompleksitet | Højere | Lavere |
Claude Code hooks
imux integrerer med Claude Code via hooks for at notificere dig når opgaver er fuldført.
1. Opret hook-scriptet
#!/bin/bash
# Skip if not in icc
[ -S /tmp/icc.sock ] || exit 0
EVENT=$(cat)
EVENT_TYPE=$(echo "$EVENT" | jq -r '.hook_event_name // "unknown"')
TOOL=$(echo "$EVENT" | jq -r '.tool_name // ""')
case "$EVENT_TYPE" in
"Stop")
icc notify --title "Claude Code" --body "Session complete"
;;
"PostToolUse")
[ "$TOOL" = "Task" ] && icc notify --title "Claude Code" --body "Agent finished"
;;
esacchmod +x ~/.claude/hooks/icc-notify.sh2. Konfigurér Claude Code
{
"hooks": {
"Stop": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "~/.claude/hooks/icc-notify.sh"
}
]
}
],
"PostToolUse": [
{
"matcher": "Task",
"hooks": [
{
"type": "command",
"command": "~/.claude/hooks/icc-notify.sh"
}
]
}
]
}
}Genstart Claude Code for at anvende hooks.
Integrationseksempler
Notificér efter lang kommando
# Add to your shell config
notify-after() {
"$@"
local exit_code=$?
if [ $exit_code -eq 0 ]; then
icc notify --title "✓ Command Complete" --body "$1"
else
icc notify --title "✗ Command Failed" --body "$1 (exit $exit_code)"
fi
return $exit_code
}
# Usage: notify-after npm run buildPython
import sys
def notify(title: str, body: str):
"""Send OSC 777 notification."""
sys.stdout.write(f'\x1b]777;notify;{title};{body}\x07')
sys.stdout.flush()
notify("Script Complete", "Processing finished")Node.js
function notify(title, body) {
process.stdout.write(`\x1b]777;notify;${title};${body}\x07`);
}
notify('Build Done', 'webpack finished');tmux passthrough
Hvis du bruger tmux inde i imux, aktivér passthrough:
set -g allow-passthrough onprintf '\ePtmux;\e\e]777;notify;Title;Body\a\e\\'