From 01822688b2bac01b0934b4d7e73de4aad5e8cf07 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Sat, 21 Aug 2021 20:41:44 -0400 Subject: lib/panel/volmon: Display dB instead of % --- (limited to 'lib/panel/volmon') diff --git a/lib/panel/volmon b/lib/panel/volmon index 0b1b87e..705ae30 100755 --- a/lib/panel/volmon +++ b/lib/panel/volmon @@ -3,8 +3,9 @@ main() { vol="$(amixer get Master,0 | \ - sed -n 's/^.*Playback [0-9]* \[\([0-9]*\)%\].*$/\1/p')" - printf '🔉%3d%%\n' ${vol} + sed -n 's/^.*Playback [0-9]* \[[0-9]*%\] '$(: \ + )'\[\(-*[0-9]*\)\.[0-9]*dB\] .*$/\1/p')" + printf '🔉%3ddB\n' ${vol} } main "${@}" -- cgit v0.9.1