music: Add soundboard
This commit is contained in:
parent
97a4e95ca8
commit
2e47c6744f
7 changed files with 141 additions and 0 deletions
16
roles/music/templates/shutdown-sound.service
Normal file
16
roles/music/templates/shutdown-sound.service
Normal file
|
@ -0,0 +1,16 @@
|
|||
# Managed by Ansible
|
||||
|
||||
[Unit]
|
||||
Description=Goodbye
|
||||
Requires=mpd.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/bin/true
|
||||
ExecStop=/opt/shutdown.sh
|
||||
RemainAfterExit=true
|
||||
User=audio
|
||||
Group=audio
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
8
roles/music/templates/shutdown-sound.sh
Normal file
8
roles/music/templates/shutdown-sound.sh
Normal file
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Managed by Ansible
|
||||
|
||||
systemctl stop trollibox.service
|
||||
mpc clear
|
||||
|
||||
su audio -c 'mplayer -volume 10 -ao jack:name=MPlayer /opt/sounds/shutdown.mp3'
|
15
roles/music/templates/soundboard.service
Normal file
15
roles/music/templates/soundboard.service
Normal file
|
@ -0,0 +1,15 @@
|
|||
# Managed by Ansible
|
||||
|
||||
[Unit]
|
||||
Description=MQTT Soundboard
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/opt/soundboard/.venv/bin/python /opt/soundboard/soundboard.py /etc/soundboard.yaml
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
User=root
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
21
roles/music/templates/soundboard.yaml
Normal file
21
roles/music/templates/soundboard.yaml
Normal file
|
@ -0,0 +1,21 @@
|
|||
loglevel: INFO
|
||||
|
||||
mqtt:
|
||||
host: mqtt.bitlair.nl
|
||||
|
||||
sounds:
|
||||
directory: /opt/sounds
|
||||
play_cmd: "mplayer -volume 10 -ao jack:name=MPlayer %s"
|
||||
topic: bitlair/soundboard
|
||||
|
||||
aliases:
|
||||
- sound: space_open
|
||||
topic: bitlair/state
|
||||
value: open
|
||||
- sound: space_close
|
||||
topic: bitlair/state
|
||||
value: close
|
||||
- sound: doorbell
|
||||
topic: bitlair/doorduino/doorbell
|
||||
- sound: nomunnie
|
||||
topic: bitlair/bank/shame
|
Loading…
Add table
Add a link
Reference in a new issue