Skip to content

Commit

Permalink
Change definition of CURVOL and SRCVOL, closes #67
Browse files Browse the repository at this point in the history
  • Loading branch information
graysky2 committed May 9, 2021
1 parent 5cf894e commit 1eb2a0c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION = 1.69
VERSION = 1.70
PN = pulseaudio-ctl

PREFIX ?= /usr
Expand Down
9 changes: 3 additions & 6 deletions common/pulseaudio-ctl.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
VERS="@VERSION@"
SKEL="@SKELDIR@/config.skel"
CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/pulseaudio-ctl/config"
LANG=C

BLD="\e[01m"
BLU="\e[01;34m"
Expand Down Expand Up @@ -132,19 +133,15 @@ checkconfig() {
}

refreshcurvol() {
# this worked some versions of PA 4 but is no longer valid with v5
# CURVOL=$(pacmd list-sinks|grep -A 15 '* index'| awk '/base volume: /{ print $5 }'|sed 's/%//')
[[ $PCV -eq 0 ]] &&
CURVOL=$(pacmd list-sinks|grep -A 15 '* index'| awk '/volume: /{ print $3 }' | grep -m 1 % |sed 's/[%|,]//g') ||
CURVOL=$(pacmd list-sinks|grep -A 15 '* index'| awk '/volume: front/{ print $5 }' | sed 's/[%|,]//g')
CURVOL=$(pacmd list-sinks|grep -A 15 '* index'| awk '/volume: /{ print $5 }' | grep -m 1 % |sed 's/[%|,]//g')
}

refreshsrcvol() {
# this worked some versions of PA 4 but is no longer valid with v5
# SRCVOL=$(pacmd list-sources|grep -A 15 '* index'| awk '/base volume: /{ print $5 }'|sed 's/%//')
[[ $PCV -eq 0 ]] &&
SRCVOL=$(pacmd list-sources|grep -A 15 '* index'| awk '/volume: /{ print $3 }' | grep -m 1 % |sed 's/[%|,]//g') ||
SRCVOL=$(pacmd list-sources|grep -A 15 '* index'| awk '/volume: front/{ print $5 }' | sed 's/[%|,]//g')
SRCVOL=$(pacmd list-sources|grep -A 15 '* index'| awk '/volume: /{ print $5 }' | grep -m 1 % |sed 's/[%|,]//g')
}

refreshbarvolperc() {
Expand Down

0 comments on commit 1eb2a0c

Please sign in to comment.