moved all desktop utils into this repo

This commit is contained in:
willifan 2024-06-03 11:56:16 +02:00
parent cd7e93374e
commit 2241d30a86
28 changed files with 151 additions and 45 deletions

24
ewwScripts/volume.sh Executable file
View 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