commit 7e3b7a4d9614bd8f70ac4f8395e6a3f2bf13294c parent 0af54804a99fa02275d5fa6ae396e6ca7c196c0c Author: Cem Keylan <cem@ckyln.com> Date: Wed, 12 Feb 2020 13:34:31 +0300 add alsa function Diffstat:
A | func/sb_alsa | | | 12 | ++++++++++++ |
1 file changed, 12 insertions(+), 0 deletions(-)
diff --git a/func/sb_alsa b/func/sb_alsa @@ -0,0 +1,12 @@ +# Checks alsa volume information + +alsa() { + printf "VOL: " + info="$(amixer get Master)" + printf '%s' "$info" | grep -q "\[off\]" && \ + printf 'MUTED %s ' "$DELIMITER" && return 0 + + printf '%s' "$info" | grep -o "\[[0-9]\+%\]" | sed 's/\[//;s/\]//' | tr -d '\n' + printf ' %s ' "$DELIMITER" + +}