-
Notifications
You must be signed in to change notification settings - Fork 36
Examples
This page provides practical examples and configuration recipes for common use cases.
- Basic Setups
- Headphones-Optimized Setup
- Multi-Device Audio Management
- Status Bar Integration
- Automated Volume Profiles
- Advanced Scripts
- Notification Customization
- Per-Application Control
The simplest configuration - just enable notifications:
# ~/.config/i3-volume/config
DISPLAY_NOTIFICATIONS=true
NOTIFICATION_METHOD="dunst"
DEFAULT_STEP=5Complete setup for i3blocks with notifications:
# ~/.config/i3-volume/config
STATUSLINE="i3blocks"
SIGNAL="SIGRTMIN+10"
NOTIFICATION_METHOD="dunst"
USE_DUNSTIFY=true
DISPLAY_NOTIFICATIONS=true
DEFAULT_STEP=5i3blocks config (~/.config/i3blocks/config):
[i3volume]
label=🔊
command=~/i3-volume/volume output i3blocks
interval=once
signal=10Complete setup for polybar:
# ~/.config/i3-volume/config
NOTIFICATION_METHOD="dunst"
DISPLAY_NOTIFICATIONS=true
DEFAULT_STEP=5polybar config:
[module/i3-volume]
type = custom/script
tail = true
label = %output%
exec = ~/i3-volume/volume listen "%i %v %p\n"
scroll-up = ~/i3-volume/volume up
scroll-down = ~/i3-volume/volume down
click-left = ~/i3-volume/volume muteOptimized for headphones with fine control and no notifications:
# ~/.config/i3-volume/config
# Global settings
DEFAULT_STEP=2 # Smaller steps for fine control
MAX_VOL=150 # Headphones can go louder
DISPLAY_NOTIFICATIONS=false # You can hear the changes
# Per-sink settings for headphones
# Find your headphone sink name with: volume list sinks
SINK_MAX_VOL[USB Audio]=150
SINK_DEFAULT_STEP[USB Audio]=2
SINK_DISPLAY_NOTIFICATIONS[USB Audio]=false
SINK_BALANCE[USB Audio]=0 # Centered- Fine-grained volume control (2% steps)
- Higher maximum volume (150%)
- No notification spam (you can hear changes)
- Perfect for music production or critical listening
Manage multiple audio devices with different settings:
# ~/.config/i3-volume/config
# Global defaults
DEFAULT_STEP=5
MAX_VOL=100
DISPLAY_NOTIFICATIONS=true
# Headphones - fine control, louder, no notifications
SINK_MAX_VOL[USB Audio]=150
SINK_DEFAULT_STEP[USB Audio]=2
SINK_DISPLAY_NOTIFICATIONS[USB Audio]=false
# Speakers - larger steps, limited volume, with notifications
SINK_MAX_VOL[alsa_output.pci-0000_00_1f.3.analog-stereo]=100
SINK_DEFAULT_STEP[alsa_output.pci-0000_00_1f.3.analog-stereo]=10
SINK_DISPLAY_NOTIFICATIONS[alsa_output.pci-0000_00_1f.3.analog-stereo]=true
# Bluetooth speaker - medium settings
SINK_MAX_VOL[bluez_sink]=120
SINK_DEFAULT_STEP[bluez_sink]=5
SINK_DISPLAY_NOTIFICATIONS[bluez_sink]=trueAdd to ~/.config/i3/config:
# Switch between audio devices
bindsym $mod+F8 exec --no-startup-id ~/i3-volume/volume -n next
bindsym $mod+Shift+F8 exec --no-startup-id ~/i3-volume/volume -n previ3blocks automatically handles mouse wheel - no extra config needed!
[i3volume]
label=🔊
command=~/i3-volume/volume output i3blocks
interval=once
signal=10
color=#b8bb26Just scroll on the volume block to adjust volume!
[module/i3-volume]
type = custom/script
tail = true
label = %output%
exec = ~/i3-volume/volume listen "%i %v %p\n"
scroll-up = ~/i3-volume/volume up
scroll-down = ~/i3-volume/volume down
click-left = ~/i3-volume/volume mute
click-right = ~/i3-volume/volume list sinks
click-middle = ~/i3-volume/volume switchCreate a custom format for your status bar:
# Simple format
volume output "%i %v%%"
# With progress bar
volume output "%i %v%% %p"
# With sink name
volume output "%i %v%%\n%s"
# Conditional formatting
volume output "%v{>50:🔊:🔉} %v%%"Create profiles for different times of day:
# Save profiles
volume set 30
volume profile save quiet
volume set 60
volume profile save normal
volume set 80
volume profile save loudUse with cron or systemd timer to switch automatically:
# Morning - quiet
0 7 * * * ~/i3-volume/volume profile quiet
# Day - normal
0 9 * * * ~/i3-volume/volume profile normal
# Evening - loud
0 18 * * * ~/i3-volume/volume profile loud# Music listening
volume set 70
volume balance 0
volume profile save music
# Gaming
volume set 80
volume balance -5
volume profile save gaming
# Video calls
volume set 50
volume mic set 75
volume profile save video-call#!/bin/bash
# safe-volume-up.sh
if ~/i3-volume/volume up 5; then
echo "Volume increased"
else
case $? in
33) notify-send "Volume limit reached" ;;
64) notify-send "Invalid command" ;;
69) notify-send "Audio system unavailable" ;;
esac
exit 1
fiTemporarily boost volume to hear important notifications:
#!/bin/bash
# boost-for-notification.sh
# Boost volume by 20% for 5 seconds
~/i3-volume/volume boost 20 5
# Send your notification
notify-send "Important Message" "Check this out!"
# Volume automatically restores after 5 secondsKeep all audio devices at the same volume:
#!/bin/bash
# sync-volumes.sh
# Sync all sinks to current default sink volume
~/i3-volume/volume syncRun this after switching sinks or on startup.
Normalize volumes across all applications:
#!/bin/bash
# normalize-audio.sh
# Normalize all sources to 75%
~/i3-volume/volume normalize apply 75Useful for maintaining consistent volume levels.
# ~/.config/i3-volume/config
NOTIFICATION_METHOD="dunst"
USE_DUNSTIFY=true
DISPLAY_NOTIFICATIONS=true
SHOW_VOLUME_PROGRESS=true
PROGRESS_PLACEMENT="body"
USE_FULLCOLOR_ICONS=true
EXPIRES=2000
NOTIFICATION_GROUP=true # Group volume change notifications# Use emoji icons
volume -j "🔇,🔊,🔉,🔊" -n up 5
# Or set in config
# Note: This requires using -j flag each time or creating a wrapper scriptWhen using multiple sinks, notifications automatically show sink name. For custom formats:
# Custom notification format
volume -n output "%i %v%%\n%s"Lower background music while keeping video audio normal:
# List applications
volume app list
# Lower music player volume
volume app spotify set 30
# Keep video at normal volume
volume app mpv set 80# Mute browser during video call
volume app firefox mute
# Unmute when done
volume app firefox mute # Toggle backCreate scripts for different scenarios:
#!/bin/bash
# music-mode.sh
volume app spotify set 80
volume app firefox set 20 # Lower browser
volume profile save music-mode#!/bin/bash
# morning-setup.sh
# Set quiet volume for morning
volume profile quiet
# Enable notifications
volume -n set 30
# Sync all devices
volume sync#!/bin/bash
# gaming-setup.sh
# Higher volume
volume set 85
# Slight left balance (if needed)
volume balance -5
# Lower background apps
volume app discord set 60
volume app spotify set 40
# Save profile
volume profile save gaming#!/bin/bash
# video-call-setup.sh
# Moderate volume
volume set 50
# Ensure microphone is unmuted and at good level
volume mic mute # Toggle to ensure unmuted
volume mic set 75
# Lower other apps
volume app spotify mute
volume app firefox set 30Organize your configuration across multiple files:
# ~/.config/i3-volume/config
source notifications.dunst
source volume-control.conf
source per-sink.confNOTIFICATION_METHOD="dunst"
USE_DUNSTIFY=true
DISPLAY_NOTIFICATIONS=true
USE_FULLCOLOR_ICONS=true
SHOW_VOLUME_PROGRESS=trueDEFAULT_STEP=5
MAX_VOL=100
FADE_DURATION=500SINK_MAX_VOL[USB Audio]=150
SINK_DEFAULT_STEP[USB Audio]=2
SINK_DISPLAY_NOTIFICATIONS[USB Audio]=false- Configuration - Complete configuration reference
- Features - All available features
- Tips & Tricks - Advanced usage patterns
- Getting Started - Setup guide