diff options
| author | Camil Staps | 2016-02-19 21:55:09 +0100 | 
|---|---|---|
| committer | Camil Staps | 2016-11-30 19:11:07 +0100 | 
| commit | 3777a430a392be708141923daa10fdd887706c0a (patch) | |
| tree | 14ce47a5291c85584e45a3bc11beb55e7ca60b9f /bin/volume | |
| parent | TeX tabwidth 2 (diff) | |
Update volume in xmobar through a logger
Diffstat (limited to 'bin/volume')
| -rwxr-xr-x | bin/volume | 13 | 
1 files changed, 13 insertions, 0 deletions
| diff --git a/bin/volume b/bin/volume new file mode 100755 index 0000000..1250a80 --- /dev/null +++ b/bin/volume @@ -0,0 +1,13 @@ +#!/bin/bash +outputs=(Left Right) +i=1 +for o in ${outputs[@]}; do +    vol=$(amixer get Master |grep "$o" |grep %) +    if [[ "$vol" == *"off"* ]]; then +        volumes[$i]="M" +    else +        volumes[$i]=$(echo $vol |awk '{print $5}'|sed 's/[^0-9%]//g') +    fi +    let i=i+1 +done +echo ${volumes[*]} | 
