From 08a457b98bd15f86a1fd81aed6e58f25e5c755c5 Mon Sep 17 00:00:00 2001 From: Jakub Czajka Date: Sun, 21 Jun 2026 15:43:30 +0200 Subject: [PATCH] [home] Add desktop notification hooks for Claude Code. Send dunstify notifications on permission_prompt and idle_prompt events via a shell script alongside the existing guix-check hook. Uses a single Notification matcher entry in project settings.json referenced via CLAUDE_PROJECT_DIR. Co-Authored-By: Claude --- .claude/hooks/notify | 26 ++++++++++++++++++++++++++ .claude/settings.json | 12 ++++++++++++ 2 files changed, 38 insertions(+) create mode 100755 .claude/hooks/notify diff --git a/.claude/hooks/notify b/.claude/hooks/notify new file mode 100755 index 0000000..4a9ef55 --- /dev/null +++ b/.claude/hooks/notify @@ -0,0 +1,26 @@ +#!/bin/sh +# Copyright (c) 2026 Jakub Czajka +# License: GPL-3.0 or later. +# +# notify — send a desktop notification for Claude Code events. + +type=$(sed -n \ + 's/.*"notification_type":"\([^"]*\)".*/\1/p') +case "$type" in + permission_prompt) + body="🤖🔐 Needs Approval" + ;; + idle_prompt) + body="🤖✅ Finished" + ;; + *) + exit 0 + ;; +esac + +$HOME/.guix-home/profile/bin/dunstify \ + --urgency normal \ + --timeout 10000 \ + --appname "Claude Code" \ + "Claude Code" \ + "$body" diff --git a/.claude/settings.json b/.claude/settings.json index 4a8d302..d15a659 100644 --- a/.claude/settings.json +++ b/.claude/settings.json @@ -22,6 +22,18 @@ } ] } + ], + "Notification": [ + { + "matcher": "permission_prompt|idle_prompt", + "hooks": [ + { + "type": "command", + "command": "${CLAUDE_PROJECT_DIR}/.claude/hooks/notify", + "async": true + } + ] + } ] } } -- 2.47.3