dwmblocks/scripts/dwmblocks-volume

15 lines
287 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env zsh
let volume="$(pamixer --get-volume)"
local icon
if [[ "$(pamixer --get-mute)" = "true" ]]; then
icon='󰸈'
elif ((${volume} > 50)); then
icon='󰕾'
elif ((${volume} > 0)); then
icon='󰖀'
else
icon=''
fi
printf '%s%3d%%\n' "${icon}" "${volume}"