-
Notifications
You must be signed in to change notification settings - Fork 0
/
voldown.sh
23 lines (20 loc) · 860 Bytes
/
voldown.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
# Define the file path
asoundrc_file=~/.asoundrc
# Define the configurations
blueout_config='playback.pcm "blueout"'
softmixer_config='playback.pcm "softmixer"'
# Check if the file exists
if [ -f "$asoundrc_file" ]; then
# Check if blueout configuration is present
if grep -q "$blueout_config" "$asoundrc_file"; then
# Increase volume for blueout
volume=$(bluealsa-cli volume /org/bluealsa/hci0/dev_F0_D3_1F_78_3D_31/a2dpsrc/sink | grep -oP 'Volume: L: \K[0-9]+ R: \K[0-9]+')
new_volume=$((volume - 5))
bluealsa-cli volume /org/bluealsa/hci0/dev_F0_D3_1F_78_3D_31/a2dpsrc/sink "$new_volume" "$new_volume"
# Check if softmixer configuration is present
elif grep -q "$softmixer_config" "$asoundrc_file"; then
# Increase volume for softmixer
amixer -q set Master 5%- unmute
fi
fi