Re: [Banshee-List] volume control granularity



On Sun, Apr 20, 2014 at 01:59:14PM -0700, meeotch wrote:
Is there any way of having finer control over volume?  If I scroll on the
button, it moves by 5%.  If click on +/-, it moves by a ridiculous 20%.  If
I grab it and drag it, I can sometimes get 2-3%, but it's incredibly fiddly
and I often have to overshoot in both directions a couple of times before I
can "nudge" it from odd to even or whatever, in order to then drag it back
to the next highest 1%.  Using the (very excellent, if simple) Banshee
Remote android app, I get 10%.

I don't have a solution for Banshee, but I have this handy little script that
nudges the Pulseaudio volume by just the amount you need.

Stick it in ~/bin, and then use it like:

Bump volume by 1%:
$ ctrl-volume +1

Decrease volume by 1%:
$ ctrl-volume -1

I used this mainly as a command to feed into the keyboard shortcuts as a
secondary volume control mechanism.

-- 
Kind regards,
Loong Jin
#!/bin/sh

sink="$(pactl info | sed -n 's/Default Sink: //p')"
volume_sinknum="$(pactl list sinks | awk -v wanted_sink="$sink" '
$1 == "Sink"  {sinknum = gensub("^#", "", 1, $2)}
$1 == "Name:" {name = $2}
name == wanted_sink && $1 == "Volume:" {
    print gensub("%$", "", 1, $3) ";" sinknum
}')"

volume=${volume_sinknum%;*}
sinknum=${volume_sinknum#*;}

inc="$1"

[ -z "$inc" ] && exit
target_volume=$(($volume + $inc))
if [ $target_volume -gt 100 ]; then
    target_volume=100
fi

pactl set-sink-volume "$sinknum" "$target_volume%"

Attachment: signature.asc
Description: Digital signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]