mirror of
https://github.com/pigmonkey/spark.git
synced 2026-01-23 02:24:09 +00:00
auto switch usb audio devices
This commit is contained in:
parent
683e6a0f3f
commit
feb6dae047
5 changed files with 15 additions and 1 deletions
|
|
@ -28,6 +28,7 @@
|
|||
- { role: development }
|
||||
- { role: backup }
|
||||
- { role: mapping }
|
||||
- { role: sound }
|
||||
vars_prompt:
|
||||
- name: user_password
|
||||
prompt: "Enter desired user password"
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@
|
|||
- unrar
|
||||
- bc
|
||||
- ranger
|
||||
- alsa-utils
|
||||
|
||||
- name: Create AUR directory
|
||||
file: path=/home/{{ user.name }}/{{ aur.dir }}
|
||||
|
|
|
|||
5
roles/sound/files/udev.rules
Normal file
5
roles/sound/files/udev.rules
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
Set USB device as default sound card when plugged in
|
||||
KERNEL=="pcmC[D0-9cp]*", ACTION=="add", PROGRAM="/bin/sh -c 'K=%k; K=$${K#pcmC}; K=$${K%%D*}; echo defaults.ctl.card $$K > /etc/asound.conf; echo defaults.pcm.card $$K >>/etc/asound.conf'"
|
||||
|
||||
# Restore default sound card when USB device unplugged
|
||||
KERNEL=="pcmC[D0-9cp]*", ACTION=="remove", PROGRAM="/bin/sh -c 'echo defaults.ctl.card 0 > /etc/asound.conf; echo defaults.pcm.card 0 >>/etc/asound.conf'"
|
||||
3
roles/sound/meta/main.yml
Normal file
3
roles/sound/meta/main.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
dependencies:
|
||||
- { role: base }
|
||||
6
roles/sound/tasks/main.yml
Normal file
6
roles/sound/tasks/main.yml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
- name: Install alsa-utils
|
||||
pacman: name=alsa-utils state=present
|
||||
|
||||
- name: Copy udev rule for USB audio device switching
|
||||
copy: src=udev.rules dest=/etc/udev/rules.d/00-local.rules
|
||||
Loading…
Add table
Add a link
Reference in a new issue