add optional aplay-at-startup service
Installs service file in /etc/systemd/system/, then disables. Prompts user to enable, and triggers reboot dialog if installed.
This commit is contained in:
parent
4aecc73356
commit
c84c0249ea
1 changed files with 26 additions and 0 deletions
26
i2samp.sh
26
i2samp.sh
|
|
@ -438,6 +438,32 @@ EOL
|
||||||
|
|
||||||
sudo mv ~/asound.conf /etc/asound.conf
|
sudo mv ~/asound.conf /etc/asound.conf
|
||||||
|
|
||||||
|
newline
|
||||||
|
echo "Installing aplay systemd unit"
|
||||||
|
sudo sh -c 'cat > /etc/systemd/system/aplay.service' << 'EOL'
|
||||||
|
[Unit]
|
||||||
|
Description=Invoke aplay from /dev/zero at system start.
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
ExecStart=/usr/bin/aplay /dev/zero
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
EOL
|
||||||
|
|
||||||
|
sudo systemctl daemon-reload
|
||||||
|
sudo systemctl disable aplay
|
||||||
|
newline
|
||||||
|
echo "You can optionally activate '/dev/zero' playback in"
|
||||||
|
echo "the background at boot. This will remove all"
|
||||||
|
echo "popping/clicking but does use some processor time."
|
||||||
|
newline
|
||||||
|
if confirm "Activate '/dev/zero' playback in background? [RECOMMENDED]"; then
|
||||||
|
newline
|
||||||
|
sudo systemctl enable aplay
|
||||||
|
ASK_TO_REBOOT=true
|
||||||
|
fi
|
||||||
|
|
||||||
if [ $bcm2835off == "yes" ]; then
|
if [ $bcm2835off == "yes" ]; then
|
||||||
newline
|
newline
|
||||||
echo "We can now test your $productname"
|
echo "We can now test your $productname"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue