diff options
Diffstat (limited to 'vol')
-rwxr-xr-x | vol | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -43,7 +43,7 @@ FONT=12x24 # What color is the OSD bar and text? See /usr/share/X11/rgb.txt. # COLOR is for when we're unmuted, MUTECOLOR is for muted. -COLOR=green +COLOR=orange MUTECOLOR=red # Text drop shadow, 0 to disable. @@ -74,10 +74,10 @@ PIDFILE="$HOME/.$SELF.osd.pid" # system), the OSD bar will never get a chance to display. osd() { - local got="$( amixer $AMIXER_OPTS get $CHANNEL )" - local muted="$( echo $got | grep '\[off\]$' )" - local volpct="$( echo $got | cut -d'[' -f2 | cut -d% -f1 )" - local db="$( echo $got | cut -d'[' -f3 | cut -d']' -f1 )" + local got="$( amixer $AMIXER_OPTS get $CHANNEL | tail -1 )" + local muted="$( echo "$got" | grep '\[off\]$' )" + local volpct="$( echo "$got" | cut -d'[' -f2 | cut -d% -f1 )" + local db="$( echo "$got" | cut -d'[' -f3 | cut -d']' -f1 )" local text="Volume $db ($volpct%)" local color="$COLOR" local oldpid @@ -100,9 +100,9 @@ osd() { -P $volpct \ -p $POSITION \ -c $color \ - -s $SHADOW -T \ - "$text" \ - -f $FONT & + -s $SHADOW \ + -f $FONT \ + -T "$text" & echo "$!" > $PIDFILE } |