Skip to content

Add configurable notification modes and desktop alerts#34

Open
fetwar wants to merge 3 commits into
disler:mainfrom
fetwar:feat/notification-modes
Open

Add configurable notification modes and desktop alerts#34
fetwar wants to merge 3 commits into
disler:mainfrom
fetwar:feat/notification-modes

Conversation

@fetwar

@fetwar fetwar commented Mar 20, 2026

Copy link
Copy Markdown
  • Replace boolean --notify with --notify tts|desktop|both|off on notification.py and stop.py
  • Add desktop push notifications via notify-send (Linux)
  • Build concise contextual messages from hook input ending with project dir (e.g. "Claude needs permission for Bash in my-project")
  • Tune OpenAI TTS: verse voice, WAV format, 1.5x speed

I honestly didn't mean to make this PR yet, was still fine tuning things.

If there is interest in including this functionality I will make it merge ready by:

  • Adding error macOS and windows desktop notifications
  • revert voice changes (other than speed - surely other people are annoyed by the snails pace TTS notifications?)
  • update docs to reference the arg changes for --notify
  • abstract desktop notifications and implement them for all of the other notification hooks

notification.py & stop.py:
- Replace boolean --notify with --notify tts|desktop|both|off
- Add desktop push notifications via notify-send
- Concise contextual messages ending with project dir

openai_tts.py:
- Use "verse" voice, WAV format, 1.5x speed for faster alerts
Comment thread .claude/hooks/utils/tts/openai_tts.py Outdated
Comment on lines +71 to +73
voice="verse",
input=text,
instructions="Speak in a cheerful, positive yet professional tone.",
response_format="mp3",
instructions="Speak fast",

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was for personal preference, I lowkey didn't mean to include in this PR so can revert if you wish.

I find the increase in talking speed to be significantly better though, it was painfully slow

instructions="Speak in a cheerful, positive yet professional tone.",
response_format="mp3",
instructions="Speak fast",
response_format="wav",

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mp3 response format did not work on linux, instead only a static-like sound could be heard as it was trying to play a compressed audio file (mp3) via LocalAudioPlayer().play() which does not expect it

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fetwar added 2 commits March 20, 2026 12:07
- Bare --notify (no value) defaults to tts for backward compatibility
- Update settings.json to use explicit --notify tts and add --notify tts to Stop hook
- Revert TTS voice instructions to cheerful professional tone, keep wav format and 1.5x speed
Avoids "Error generating completion message" when the OpenAI key
lacks chat completion access.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant