first Version
This commit is contained in:
commit
0c4bef47e8
149 changed files with 32273 additions and 0 deletions
24
scripts/volume.sh
Executable file
24
scripts/volume.sh
Executable file
|
@ -0,0 +1,24 @@
|
|||
#!/bin/bash
|
||||
|
||||
generate() {
|
||||
message=$(wpctl get-volume @DEFAULT_AUDIO_SINK@)
|
||||
volume=$(awk '{print $2 * 100}' <<< "$message")
|
||||
|
||||
if [[ $(awk '{print $3}' <<< "$message") == "[MUTED]" ]]; then
|
||||
muted=1
|
||||
else
|
||||
muted=0
|
||||
fi
|
||||
|
||||
echo '{"volume":"'$volume'","muted":"'$muted'"}'
|
||||
}
|
||||
|
||||
generate
|
||||
|
||||
pactl subscribe | while read -r event; do
|
||||
if [[ "$event" == *"Event 'change'"* ]]; then
|
||||
|
||||
generate
|
||||
|
||||
fi
|
||||
done
|
Loading…
Add table
Add a link
Reference in a new issue