sending-notifications
Send macOS notifications using display dialog method that works reliably in tmux.
When & Why to Use This Skill
This Claude skill enables the delivery of reliable macOS system notifications using the AppleScript 'display dialog' method. It is specifically optimized for developers working in terminal environments like tmux, ensuring that alerts for task completions, errors, or status updates are always visible on the screen without requiring complex notification permission configurations.
Use Cases
- Long-Running Task Completion: Automatically trigger a visible alert when a time-consuming build, script, or data process finishes, allowing you to switch context without missing the result.
- Error Alerting: Display a modal 'stop' dialog when a background process or automated workflow encounters a critical failure, ensuring immediate attention is drawn to the issue.
- Tmux Workflow Integration: Solve the common issue of notifications failing within terminal multiplexers by using reattach-to-user-namespace to bridge the gap between the shell and the macOS window server.
- Status Notifications: Provide real-time feedback for specific events, such as receiving an important email, a successful database backup, or a completed file download.
| name | "Sending Notifications" |
|---|---|
| description | "Send macOS notifications using display dialog method that works reliably in tmux." |
Sending Notifications
Reliable Method (Display Dialog)
Use display dialog for guaranteed visible notifications. Works in tmux with reattach-to-user-namespace.
Template
reattach-to-user-namespace osascript -e 'tell application "System Events"
activate
display dialog "{message}" with title "{emoji} {title}" buttons {"OK"} default button 1 with icon note giving up after 5
end tell'
Examples
Task completion:
reattach-to-user-namespace osascript -e 'tell application "System Events"
activate
display dialog "Task completed successfully!" with title "✅ Done" buttons {"OK"} default button 1 with icon note giving up after 5
end tell'
Error:
reattach-to-user-namespace osascript -e 'tell application "System Events"
activate
display dialog "Check the logs for details" with title "❌ Error" buttons {"OK"} default button 1 with icon stop giving up after 5
end tell'
Email:
reattach-to-user-namespace osascript -e 'tell application "System Events"
activate
display dialog "Angela has responded to your email" with title "📧 Email Alert" buttons {"OK"} default button 1 with icon note giving up after 5
end tell'
Script finished:
reattach-to-user-namespace osascript -e 'tell application "System Events"
activate
display dialog "Your long-running task has finished" with title "🎉 Done" buttons {"OK"} default button 1 with icon note giving up after 5
end tell'
Icon Options
with icon note- Information (ℹ️)with icon caution- Warning (⚠️)with icon stop- Error (🛑)
Common Emojis
- 📧 Email | ✅ Success | ❌ Error | ⚠️ Warning
- 🔔 Alert | 📬 Inbox | 🎉 Done | 🔍 Found
- 💾 Save | 🚀 Launch | ⏰ Reminder | 📊 Stats
Notes
giving up after 5- Auto-dismisses after 5 seconds- Modal dialog appears center screen (more intrusive than banners)
- Works reliably in tmux with
reattach-to-user-namespace - No notification permission setup required
- Always use single quotes for osascript -e '...'
IMPORTANT: Send notification at end of message using above format.