xbindkeys setup
I used xbindkeys. In my .xbindkeysrc config file I added these lines:
# Examples of commands:
"sh $HOME/Scripts/volume-down.sh &"
m:0x0 + c:122
"sh $HOME/Scripts/volume-up.sh &"
m:0x0 + c:123
#----
The scripts I use are found at Post #7. The process was simple. I had to modify my scripts because I have the pulseaudio equalizer running which has a separate audio device. below are my modified scripts.
#volume-up.sh
#!/bin/bash
A=`pacmd dump | grep "set-sink-volume alsa_output.pci-0000_00_1b.0.analog-stereo" | cut -d " " -f 3`
B=$((A + 0x01000))
if [ $(($B)) -gt $((0x10000)) ]
then
B=$((0x10000))
fi
pactl set-sink-volume 0 `printf "0x%X" $B`
C=`pacmd dump | grep "set-sink-volume ladspa_output.mbeq_1197.mbeq" | cut -d " " -f 3`
D=$((C + 0x10000))
if [ $(($D)) -gt $((0x10000)) ]
then
D=$((0x10000))
fi
pactl set-sink-volume 1 `printf "0x%X" $D`
#---
#volume-down.sh
#!/bin/bash
A=`pacmd dump | grep "set-sink-volume alsa_output.pci-0000_00_1b.0.analog-stereo" | cut -d " " -f 3`
B=$((A - 0x01000))
if [ $(($B)) -lt $((0x00000)) ]
then
B=$((0x00000))
fi
pactl set-sink-volume 0 `printf "0x%X" $B`
C=`pacmd dump | grep "set-sink-volume ladspa_output.mbeq_1197.mbeq" | cut -d " " -f 3`
D=$((C + 0x10000))
if [ $(($D)) -gt $((0x10000)) ]
then
D=$((0x10000))
fi
pactl set-sink-volume 1 `printf "0x%X" $D`
#---
In my matchbox session file I added these two lines.
#matchbox session file
xbindkeys &
"sh $HOME/Scripts/volume-down.sh &"
#---
Now whenever I adjust the volume it maxes out my "ladspa_output.mbeq_1197.mbeq" output. This output causse small clicks in the sound when adjusted so I decided to just max it out when adjust the volume either way. When my system boots, it runs the volume down script to pretty much just set the system volume before the music is really played. One thing that I don't like is that I can only adjust the volume 6% or less than that. I have tried different values, but 6% is about the only plausible step. If anyone has any questions about this, let me know. You can also make a mute script if you wish.



LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks