9 lines
354 B
Bash
Executable File
9 lines
354 B
Bash
Executable File
#!/usr/bin/env bash
|
|
count=$(wpctl get-volume @DEFAULT_SINK@ | cut -d' ' -f2- | sed -E 's/\.//g' | sed 's/^0*//g')
|
|
color="green"
|
|
if ((count > 75)); then color="yellow"; fi
|
|
if ((count > 90)); then color="peach"; fi
|
|
if ((count > 100)); then color="maroon"; fi
|
|
if ((count > 110)); then color="red"; fi
|
|
echo "{\"count\":\"${count}\", \"color\":\"${color}\"}"
|