This repository has been archived on 2023-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/.local/bin/statusbar/sb-volume

31 lines
806 B
Plaintext
Raw Normal View History

#!/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
######################################################################
2022-11-12 17:13:59 +01:00
level="$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | awk -F" " '{print $2*100}')"
muted="$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | awk -F" " '{print $3}')"
if [ "1" = "$muted" ]; then
2022-10-30 23:18:53 +01:00
icon="婢"
else
2022-11-12 17:13:59 +01:00
if [ "$level" -gt "70" ]; then
2022-10-30 23:18:53 +01:00
icon="墳"
2022-11-12 17:13:59 +01:00
elif [ "$level" -lt "30" ]; then
2022-10-30 23:18:53 +01:00
icon="奄"
else
icon="奔"
fi
fi
2022-11-12 17:13:59 +01:00
printf " %s %3d%% " $icon $level