moved all desktop utils into this repo
This commit is contained in:
parent
cd7e93374e
commit
2241d30a86
28 changed files with 151 additions and 45 deletions
24
ewwScripts/volume.sh
Executable file
24
ewwScripts/volume.sh
Executable file
|
@ -0,0 +1,24 @@
|
|||
#!/usr/bin/env 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