Add customizable notification sound (#839)
* Add customizable notification sound setting Adds a "Notification Sound" picker in Settings > App that lets users choose from macOS system sounds (Default, Basso, Blow, Glass, etc.) or silence notifications entirely with "None". Closes https://github.com/manaflow-ai/cmux/issues/608 * Add custom notification command with env vars and sound preview Users can set a shell command in Settings > App > Notification Command that runs on every notification. CMUX_NOTIFICATION_TITLE, CMUX_NOTIFICATION_SUBTITLE, and CMUX_NOTIFICATION_BODY env vars are set. Also adds a play button to preview system sounds and docs.
This commit is contained in:
parent
044a3dbb64
commit
a5de92e9d6
4 changed files with 175 additions and 2 deletions
|
|
@ -49,6 +49,48 @@ export default function NotificationsPage() {
|
|||
directly to the workspace with the most recent unread notification.
|
||||
</p>
|
||||
|
||||
<h2>Custom command</h2>
|
||||
<p>
|
||||
Run a shell command every time a notification is scheduled. Set it in{" "}
|
||||
<strong>Settings → App → Notification Command</strong>. The command
|
||||
runs via <code>/bin/sh -c</code> with these environment variables:
|
||||
</p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Variable</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><code>CMUX_NOTIFICATION_TITLE</code></td>
|
||||
<td>Notification title (workspace name or app name)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>CMUX_NOTIFICATION_SUBTITLE</code></td>
|
||||
<td>Notification subtitle</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>CMUX_NOTIFICATION_BODY</code></td>
|
||||
<td>Notification body text</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<CodeBlock title="Examples" lang="bash">{`# Text-to-speech
|
||||
say "$CMUX_NOTIFICATION_TITLE"
|
||||
|
||||
# Custom sound file
|
||||
afplay /path/to/sound.aiff
|
||||
|
||||
# Log to file
|
||||
echo "$CMUX_NOTIFICATION_TITLE: $CMUX_NOTIFICATION_BODY" >> ~/notifications.log`}</CodeBlock>
|
||||
<p>
|
||||
The command runs independently of the system sound picker. Set the
|
||||
picker to "None" to use only the custom command, or keep both for a
|
||||
system sound plus a custom action.
|
||||
</p>
|
||||
|
||||
<h2>Sending notifications</h2>
|
||||
|
||||
<h3>CLI</h3>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue