fix(scripts): switch pactl to wpctl
This commit is contained in:
parent
bdfa3988f9
commit
956c7718a4
1 changed files with 5 additions and 5 deletions
|
|
@ -22,15 +22,15 @@ while getopts ":bvt:p:" options; do
|
||||||
;;
|
;;
|
||||||
v)
|
v)
|
||||||
# Get volume (don't use pamixer because that is way slower)
|
# Get volume (don't use pamixer because that is way slower)
|
||||||
value=$( pactl get-sink-volume @DEFAULT_SINK@ \
|
float=$( wpctl get-volume @DEFAULT_SINK@ \
|
||||||
| grep -o '[0-9]*%' \
|
| grep -Eo '[01].[0-9]{2}' )
|
||||||
| tr -d '%' \
|
# Converting to base 10 to drop leading zeroes
|
||||||
| head -n1 )
|
value="$(( 10#"$( tr -d '.' <<< "${float}" )" ))"
|
||||||
title="Volume: ${value}%"
|
title="Volume: ${value}%"
|
||||||
category='sysinfo'
|
category='sysinfo'
|
||||||
|
|
||||||
# If audio disabled, set value to zero.
|
# If audio disabled, set value to zero.
|
||||||
if [ "$( pactl get-sink-mute @DEFAULT_SINK@ | grep -o '\(yes\|no\)' | head -n1 )" == 'yes' ] ; then
|
if [ ! -z "$( wpctl get-volume @DEFAULT_SINK@ | grep '[MUTED]' )" ] ; then
|
||||||
title="Volume: ${value}% (Disabled)"
|
title="Volume: ${value}% (Disabled)"
|
||||||
value=0
|
value=0
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue