dotfiles/.config/eww/scripts/get-volume.sh

9 lines
319 B
Bash
Raw Normal View History

2024-11-05 14:09:13 +01:00
#!/bin/bash
input=$(wpctl get-volume @DEFAULT_AUDIO_SOURCE@ | awk '{print "{\"value\": " $2 * 100 ", \"muted\": " ($3 == "[MUTED]") "}"}')
output=$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | awk '{print "{\"value\": " $2 * 100 ", \"muted\": " ($3 == "[MUTED]") "}"}')
cat << EOF
{"input": $input, "output": $output}
EOF