- Shell 100%
| finish | ||
| install.sh | ||
| README.md | ||
| run | ||
Speaker Keepalive Service for Void Linux
A runit service that keeps a Bluetooth speaker connected by playing an inaudible tone periodically.
Quick Installation
sudo ./install.sh
The installer will:
- Copy service files to
/etc/sv/speaker_keepalive/ - Create an
envfile with auto-detected user - Enable the service via symlink to
/var/service/
Manual Installation
-
Copy the service directory to
/etc/sv/:sudo cp -r speaker_keepalive /etc/sv/ -
Make the scripts executable:
sudo chmod +x /etc/sv/speaker_keepalive/run sudo chmod +x /etc/sv/speaker_keepalive/finish -
Enable the service (symlink to /var/service/):
sudo ln -s /etc/sv/speaker_keepalive /var/service/
Configuration
The service auto-detects the user with an active PipeWire session. To specify a particular user, edit /etc/sv/speaker_keepalive/env:
SPEAKER_USER=yourusername
Then restart the service:
sudo sv restart speaker_keepalive
Service Management Commands
-
Check service status:
sudo sv status speaker_keepalive -
Stop the service:
sudo sv stop speaker_keepalive -
Start the service:
sudo sv start speaker_keepalive -
Restart the service:
sudo sv restart speaker_keepalive -
Disable (remove from runit):
sudo sv stop speaker_keepalive sudo rm /var/service/speaker_keepalive
View Logs
Logs are available at /var/log/speaker_keepalive/:
tail -f /var/log/speaker_keepalive/current
Requirements
-
soxpackage (provides theplaycommand):sudo xbps-install sox -
PipeWire audio system (the service connects to the user's PipeWire session)
-
chpstfrom runit (usually included with runit installation)
How It Works
The service runs as root but drops privileges to the target user to access their PipeWire audio session. Every 4 minutes, it plays a 100Hz sine wave at very low volume (0.1) for 1 second to keep the Bluetooth speaker active and prevent auto-disconnect.