Created
August 14, 2025 11:50
-
-
Save runekaagaard/a98ff7a1cca44021a043027c1b28b42e to your computer and use it in GitHub Desktop.
Claude Code Terminator Notification Hooks - Pleasant sounds and tab title updates with emoji indicators
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Notification script for Claude Code - sounds and tab title via remotinator | |
# Emojis: π΄ (running), π’ (stopped), π¨ (needs approval) | |
# Exit early if TERMINATOR_UUID is not set | |
if [ -z "$TERMINATOR_UUID" ]; then | |
exit 0 | |
fi | |
HOOK_TYPE="$1" | |
# Function to update tab title | |
update_title() { | |
local emoji="$1" | |
# Use remotinator to update tab title | |
CURRENT_TITLE=$(remotinator --uuid "$TERMINATOR_UUID" get_tab_title 2>/dev/null | head -n 1) | |
CLEAN_TITLE=$(printf "%s" "$CURRENT_TITLE" | sed -E 's/^(π΄|π’|π¨) //') | |
remotinator --uuid "$TERMINATOR_UUID" set_tab_title -t "$emoji $CLEAN_TITLE" >/dev/null 2>&1 | |
} | |
case "$HOOK_TYPE" in | |
"UserPromptSubmit") | |
# Claude is running/processing | |
paplay /usr/share/sounds/freedesktop/stereo/message.oga 2>/dev/null & | |
update_title "π΄" | |
;; | |
"Stop") | |
# Claude finished responding | |
paplay /usr/share/sounds/freedesktop/stereo/complete.oga 2>/dev/null & | |
update_title "π’" | |
;; | |
"Notification") | |
# Tool approval needed | |
paplay /usr/share/sounds/freedesktop/stereo/dialog-information.oga 2>/dev/null & | |
update_title "π¨" | |
;; | |
esac | |
exit 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"env": {}, | |
"includeCoAuthoredBy": false, | |
"permissions": { | |
"allow": [], | |
"deny": [] | |
}, | |
"hooks": { | |
"UserPromptSubmit": [ | |
{ | |
"hooks": [ | |
{ | |
"type": "command", | |
"command": "~/.claude/hooks/notify.sh UserPromptSubmit" | |
} | |
] | |
} | |
], | |
"Stop": [ | |
{ | |
"hooks": [ | |
{ | |
"type": "command", | |
"command": "~/.claude/hooks/notify.sh Stop" | |
} | |
] | |
} | |
], | |
"Notification": [ | |
{ | |
"hooks": [ | |
{ | |
"type": "command", | |
"command": "~/.claude/hooks/notify.sh Notification" | |
} | |
] | |
} | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment