~set_bar -> scripts/status/*

Decomposed the set_bar monolith script into seperate 'block' scripts
This commit is contained in:
dx
2020-06-06 19:31:36 +01:00
parent 852d280157
commit 45b80e8e67
7 changed files with 67 additions and 89 deletions

View File

@@ -0,0 +1,21 @@
#!/usr/bin/env bash
sinks="$(pactl list sinks)"
vol="$(echo "$sinks" | grep '[0-9]\+%' | sed "s,.* \([0-9]\+\)%.*,\1,;1q")"
mpc_vol="$($HOME/.local/scripts/mpc_volume)"
if [[ $vol -gt 50 ]]
then
icon=""
elif [[ $vol -gt 10 ]]
then
icon=""
else
icon=""
fi
if [[ $mpc_vol == "n/a" ]]
then
echo "$icon $vol%"
else
echo "$icon $vol% $mpc_vol%"
fi