~set_bar -> scripts/status/*
Decomposed the set_bar monolith script into seperate 'block' scripts
This commit is contained in:
21
Scripts/.local/scripts/status/volume
Executable file
21
Scripts/.local/scripts/status/volume
Executable 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
|
||||
Reference in New Issue
Block a user