Switch between ccbell sound profiles
Switches between preset sound notification profiles for different work modes.
/plugin marketplace add mpolatcan/cc-plugins/plugin install mpolatcan-ccbell-plugins-ccbell@mpolatcan/cc-pluginsManage and switch between sound notification profiles.
When configuring profiles, offer these presets:
| Profile | Description |
|---|---|
| default | Standard settings - all events enabled at medium volume |
| focus | Minimal interruptions - only permission prompts at low volume |
| work | Professional mode - subtle sounds for all events |
| silent | All notifications disabled |
| loud | Maximum volume for all events |
First, read the config and display the current active profile:
CONFIG_FILE="${CLAUDE_PROJECT_DIR:-.}/.claude/ccbell.config.json"
GLOBAL_CONFIG="$HOME/.claude/ccbell.config.json"
if [ -f "$CONFIG_FILE" ]; then
ACTIVE_CONFIG="$CONFIG_FILE"
elif [ -f "$GLOBAL_CONFIG" ]; then
ACTIVE_CONFIG="$GLOBAL_CONFIG"
else
echo "No config found, using defaults"
exit 0
fi
if command -v jq &>/dev/null; then
current=$(jq -r '.activeProfile // "default"' "$ACTIVE_CONFIG")
echo "Current profile: $current"
# List available profiles
profiles=$(jq -r '.profiles | keys[]? // empty' "$ACTIVE_CONFIG" 2>/dev/null)
if [ -n "$profiles" ]; then
echo "Available custom profiles:"
echo "$profiles" | sed 's/^/ - /'
fi
fi
Use AskUserQuestion to let user select a profile:
{
"questions": [
{
"question": "Which profile would you like to activate?",
"header": "Profile",
"options": [
{"label": "default", "description": "Standard settings - all events enabled"},
{"label": "focus", "description": "Minimal - only permission prompts"},
{"label": "work", "description": "Professional - subtle notifications"},
{"label": "loud", "description": "Maximum volume for all events"},
{"label": "silent", "description": "All notifications disabled"}
]
}
]
}
Based on user selection, update the config:
For preset profiles, use these configurations:
{
"activeProfile": "default"
}
(Uses standard event settings)
Create profile in config if not exists, then activate:
{
"activeProfile": "focus",
"profiles": {
"focus": {
"events": {
"stop": { "enabled": false },
"permission_prompt": { "enabled": true, "volume": 0.3 },
"idle_prompt": { "enabled": false },
"subagent": { "enabled": false }
}
}
}
}
{
"activeProfile": "work",
"profiles": {
"work": {
"events": {
"stop": { "enabled": true, "sound": "bundled:stop", "volume": 0.3 },
"permission_prompt": { "enabled": true, "sound": "bundled:permission_prompt", "volume": 0.4 },
"idle_prompt": { "enabled": true, "sound": "bundled:idle_prompt", "volume": 0.3 },
"subagent": { "enabled": true, "sound": "bundled:subagent", "volume": 0.2 }
}
}
}
}
{
"activeProfile": "silent",
"profiles": {
"silent": {
"events": {
"stop": { "enabled": false },
"permission_prompt": { "enabled": false },
"idle_prompt": { "enabled": false },
"subagent": { "enabled": false }
}
}
}
}
{
"activeProfile": "loud",
"profiles": {
"loud": {
"events": {
"stop": { "enabled": true, "sound": "bundled:stop", "volume": 1.0 },
"permission_prompt": { "enabled": true, "sound": "bundled:permission_prompt", "volume": 1.0 },
"idle_prompt": { "enabled": true, "sound": "bundled:idle_prompt", "volume": 1.0 },
"subagent": { "enabled": true, "sound": "bundled:subagent", "volume": 1.0 }
}
}
}
}
Use the Write tool to update the config file. Merge the new profile settings with existing config.
Example of reading, modifying, and writing config:
# If jq is available, merge configs properly
if command -v jq &>/dev/null; then
# Read existing config
existing=$(cat "$ACTIVE_CONFIG")
# Merge with new profile settings
# This preserves other settings while updating profile
fi
After updating, confirm to the user:
Profile changed to: [profile_name]
Settings active:
- Stop: enabled/disabled (sound, volume)
- Permission prompt: enabled/disabled (sound, volume)
- Idle prompt: enabled/disabled (sound, volume)
- Subagent: enabled/disabled (sound, volume)
Use /ccbell:test to hear your new notification sounds.
If user selects "Other" or wants to create a custom profile, guide them through:
{
"enabled": true,
"activeProfile": "work",
"events": {
"stop": { "enabled": true, "sound": "bundled:stop", "volume": 0.5 },
...
},
"profiles": {
"work": {
"events": {
"stop": { "enabled": true, "sound": "bundled:stop", "volume": 0.3 },
...
}
},
"focus": {
"events": {
"stop": { "enabled": false },
...
}
}
}
}
When a profile is active: