diff options
| author | Manuel Palenzuela <[email protected]> | 2019-06-10 23:27:09 +0200 |
|---|---|---|
| committer | Manuel Palenzuela <[email protected]> | 2019-06-10 23:27:09 +0200 |
| commit | 44b24d4c370f24b324e57be8203fbb708919b4a7 (patch) | |
| tree | 5f1e848bf5dbc40bbfd037a2827868063b5aae78 /scripts/dwm-status | |
| parent | Updated status bar (diff) | |
| download | dwm-44b24d4c370f24b324e57be8203fbb708919b4a7.tar.gz dwm-44b24d4c370f24b324e57be8203fbb708919b4a7.tar.bz2 dwm-44b24d4c370f24b324e57be8203fbb708919b4a7.zip | |
Updated status bar
Diffstat (limited to 'scripts/dwm-status')
| -rwxr-xr-x | scripts/dwm-status | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/scripts/dwm-status b/scripts/dwm-status index 6996ae5..2569053 100755 --- a/scripts/dwm-status +++ b/scripts/dwm-status @@ -19,13 +19,20 @@ status() { \ # Get the volume of ALSA's master volume output. Show an icon if or # not muted. - amixer get Master | grep -o "[0-9]*%\|\[on\]\|\[off\]" | sed "s/\[on\]//;s/\[off\]//" + active_sink=$(pacmd list-sinks | awk '/* index:/{print $3}') + curStatus=$(pacmd list-sinks | grep -A 15 "index: $active_sink$" | awk '/muted/{ print $2}') + volume=$(pacmd list-sinks | grep -A 15 "index: $active_sink$" | grep 'volume:' | grep -E -v 'base volume:' | awk -F : '{print $3}' | grep -o -P '.{0,3}%'| sed s/.$// | tr -d ' ') + if [ "${curStatus}" = 'yes' ] + then + echo " $volume%" + else + echo " $volume%" + fi echo "$delim" - # Wifi quality percentage and icon if ethernet is connected. + # Wifi quality percentage grep "^\s*w" /proc/net/wireless | awk '{ print "", int($3 * 100 / 70) "%" }' - sed "s/down//;s/up//" /sys/class/net/w*/operstate # Show unread mail command -v mw >/dev/null 2>&1 && @@ -63,5 +70,5 @@ while :; do # Sleep for a minute after changing the status bar before updating it # again. Note that the `refbar` "refreshes" the statusbar by killing # this command. Feel free to change the time interval if you want. - sleep 1m + sleep 1s done |