31 lines
812 B
Bash
Executable File
31 lines
812 B
Bash
Executable File
#!/usr/bin/env sh
|
|
|
|
######################################################################
|
|
# @author : swytch (adapted from Luke Smith - lukesmith.xyz)
|
|
# @file : sb-volume
|
|
# @license : GPLv3
|
|
# @created : Saturday Feb 13, 2021 17:51:16 CET
|
|
#
|
|
# @description : volume block for dwmblocks
|
|
######################################################################
|
|
|
|
|
|
|
|
level="$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | awk -F" " '{print $2*100}')"
|
|
muted="$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | awk -F" " '{print $3}')"
|
|
|
|
if [ "[MUTED]" = "$muted" ]; then
|
|
icon="婢"
|
|
else
|
|
if [ "$level" -gt "70" ]; then
|
|
icon="墳"
|
|
elif [ "$level" -lt "30" ]; then
|
|
icon="奄"
|
|
else
|
|
icon="奔"
|
|
fi
|
|
fi
|
|
|
|
printf " %s %3d%% " $icon $level
|
|
|