Skip to content

Commit 3f10668

Browse files
committed
feat(hooks): add system sound to notification
1 parent 0c75091 commit 3f10668

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

.gemini/hooks/notify.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,23 @@ def notify_user():
3030
stderr=subprocess.DEVNULL,
3131
stdout=subprocess.DEVNULL
3232
)
33+
34+
# Try to play a notification sound
35+
try:
36+
# Check for common system sounds
37+
sound_file = "/usr/share/sounds/freedesktop/stereo/message.oga"
38+
if not os.path.exists(sound_file):
39+
sound_file = "/usr/share/sounds/freedesktop/stereo/complete.oga"
40+
41+
# Use paplay (PulseAudio/PipeWire) if available
42+
subprocess.run(
43+
["paplay", sound_file],
44+
check=False,
45+
stderr=subprocess.DEVNULL,
46+
stdout=subprocess.DEVNULL
47+
)
48+
except Exception:
49+
pass
3350
except Exception:
3451
# Gracefully handle cases where notify-send is not installed or fails
3552
pass

0 commit comments

Comments
 (0)