Compare commits
No commits in common. "e9f31417b7903463fea97657fde725bcb7812639" and "69278069729972162dd8a58a33a2f4dd3062ca53" have entirely different histories.
e9f31417b7
...
6927806972
4 changed files with 49 additions and 2 deletions
|
@ -7,7 +7,6 @@
|
||||||
- pipewire-pulse
|
- pipewire-pulse
|
||||||
- pulseaudio-utils
|
- pulseaudio-utils
|
||||||
- pulsemixer
|
- pulsemixer
|
||||||
- wireplumber
|
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Add audio group
|
- name: Add audio group
|
||||||
|
|
|
@ -51,3 +51,34 @@
|
||||||
state: started
|
state: started
|
||||||
enabled: true
|
enabled: true
|
||||||
daemon_reload: true
|
daemon_reload: true
|
||||||
|
|
||||||
|
- name: Install skipbutton depedencies
|
||||||
|
ansible.builtin.apt:
|
||||||
|
name:
|
||||||
|
- python3-mpd
|
||||||
|
- python3-serial
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Clone skipbutton source
|
||||||
|
ansible.builtin.git:
|
||||||
|
repo: https://github.com/bitlair/skipbutton.git
|
||||||
|
version: master
|
||||||
|
dest: /opt/skipbutton
|
||||||
|
accept_hostkey: yes
|
||||||
|
notify: Restart skipbutton
|
||||||
|
|
||||||
|
- name: Install skipbutton service
|
||||||
|
ansible.builtin.template:
|
||||||
|
src: skipbutton.service
|
||||||
|
dest: /etc/systemd/system/skipbutton.service
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: 0644
|
||||||
|
notify: Restart skipbutton
|
||||||
|
|
||||||
|
- name: Enable skipbutton
|
||||||
|
ansible.builtin.systemd:
|
||||||
|
name: skipbutton
|
||||||
|
state: started
|
||||||
|
enabled: true
|
||||||
|
daemon_reload: true
|
||||||
|
|
|
@ -14,7 +14,7 @@ prev_volume=x
|
||||||
if [ $event = "mixer" ]; then
|
if [ $event = "mixer" ]; then
|
||||||
volume=`mpc volume | sed -nr 's/^volume: ([0-9]+)%$/\1/p'`
|
volume=`mpc volume | sed -nr 's/^volume: ([0-9]+)%$/\1/p'`
|
||||||
if [ "$prev_volume" != "$volume" ]; then
|
if [ "$prev_volume" != "$volume" ]; then
|
||||||
mqtt-simple -h {{ mqtt_internal_host }} -p '{{ music_mqtt_mpd_volume }}' -r -m "$volume"
|
mqtt-simple -h {{ mqtt_internal_host }} -p '{{ music_mqtt_mpd_volume }} -r' -m "$volume"
|
||||||
fi
|
fi
|
||||||
prev_volume=$volume
|
prev_volume=$volume
|
||||||
fi
|
fi
|
||||||
|
|
17
roles/music/templates/skipbutton.service
Normal file
17
roles/music/templates/skipbutton.service
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
# {{ ansible_managed }}
|
||||||
|
|
||||||
|
[Unit]
|
||||||
|
Description=MPD Skipbutton
|
||||||
|
After=network.target
|
||||||
|
Requires=mpd.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
Restart=always
|
||||||
|
RestartSec=10s
|
||||||
|
ExecStart=/opt/skipbutton/skipbutton.py /dev/ttyS0
|
||||||
|
DynamicUser=true
|
||||||
|
Group=dialout
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
Loading…
Add table
Add a link
Reference in a new issue