chore: initial commit

This commit is contained in:
2024-08-08 14:39:30 +02:00
commit 66bdf943c7
12 changed files with 1261 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
#!/bin/sh
while true
do
if ! (echo -ne '\x9' | nc -N -U /tmp/mixrs) >/dev/null 2>&1; then
echo "Offline"
exit 1
fi
raw=$(echo -ne "\x9" | nc -N -U /tmp/mixrs)
if [ ${#raw} -gt 0 ]; then
if [ $(echo "$raw" | grep "muted: " | sed 's/muted: //') = "true" ]; then
output=$(echo "$raw" | grep -e 'selection' -e 'name' | sed -E -e 's/selection: |name: |volume_percentage: //g' | tr '\n' ' ')
echo "${output}Muted"
else
output=$(echo "$raw" | grep -e 'selection' -e 'name' -e 'volume_percentage' | sed -E -e 's/selection: |name: |volume_percentage: //g' | tr '\n' ' ' | sed 's/.$/%\n/')
echo $output
fi
else
echo "0/0"
fi
sleep 0.07s
done