#!/bin/bash

muted=$(pactl get-sink-mute @DEFAULT_SINK@ | awk -F ' ' '{print $2}')

if [ $muted == "yes" ]; then
  echo "{\"alt\": \"mute\", \"class\": \"muted\", \"tooltip\": \"muted\"}"
  exit
fi

VOL=$(pactl get-sink-volume @DEFAULT_SINK@ | grep Volume | awk -F' ' '{print $5}' | sed -e 's/%$//')

echo "{\"percentage\": $VOL, \"tooltip\": \"$VOL%\"}"

