You are not logged in.
Pages: 1
My Wine programs had no sound with pulse, so I decided to move to alsa.
The only little issue I have now is the binding with volupe up/down keys. On Pulse, the script was:
#!/bin/bash
device="alsa_output.pci-0000_00_1b.0.analog-stereo"
case "$1" in
"up") # increase volume by 3000
pacmd dump | awk --non-decimal-data '$1~/set-sink-volume/{if ($2~/'${device}'/) {if ($3+1000 > 65535) {system ("pactl "$1" '${device}' "65535)} else {system ("pactl "$1" '${device}' "$3+3000)}}}'
;;
"down") # decrease volume by 3000
pacmd dump | awk --non-decimal-data '$1~/set-sink-volume/{if ($2~/'${device}'/) {if ($3-1000 < 0) {system ("pactl "$1" '${device}' "0)} else {system ("pactl "$1" '${device}' "$3-3000)}}}'
;;
"mute") # toggle mute
pacmd dump|awk --non-decimal-data '$1~/set-sink-mute/{if ($2~/'${device}'/) {system ("pactl "$1" '${device}' "($3=="yes"?"no":"yes"))}}'
;;
esac
Now, on ALSA, the above stopped working, so I changed it to:
#!/bin/bash
device="alsa_output.pci-0000_00_1b.0.analog-stereo"
case "$1" in
"up") # increase volume by 3000
amixer set PCM 5%+
;;
"down") # decrease volume by 3000
amixer set PCM 5-
;;
esac
It does change volume, but I no longer get the OSD display showing me the change, and I'd like to see it.
What can I do?
Offline
OSD display
Quick and dirty:
~/.xbindkeysrc
"/usr/bin/amixer -q sset Master 2+ && /home/brebs/bin/notifyvolume"
KP_Multiply
"/usr/bin/amixer -q sset Master 2- && /home/brebs/bin/notifyvolume"
KP_Subtract
"/usr/bin/amixer -q sset Master 0% && /home/brebs/bin/notifyvolume"
KP_Divide
notifyvolume
#!/bin/bash
exec /usr/bin/notify-send -t 1000 -i volume-knob "Volume $(amixer -q | grep -A5 Master | grep '%' | cut -d'[' -f2 | cut -d']' -f1)"
I have e.g. /usr/share/icons/gnome/16x16/apps/volume-knob.png
Offline
Thanks for the input but I was hoping for the same xfce-notifyd volume progress bar indicator as I had with pulseaudio rather than a know with 100% (which is stuck at 100% at all times, anyway)
Something like:
http://jeromeg.blog.free.fr/public/xfce … _35_34.png
except in my theme the bar is all grey. It still appears just fine if I use keyboard volume controls, but not while binding it to mouse buttons.
Offline
Just to clear this up:
(which is stuck at 100% at all times, anyway)
You probably have your "Master" as "PCM". See what it is in alsamixer. Probably the left-most control.
Offline
Well, what I said was not entirely correct. I change the volume to, say, 70%, but the indicator is stuck at 100% for about a minute. Then it appears at the correct value, but it should not be visible at that point anymore.
However, this is a little bit of a moot point, as what I am after is the volume bar which was appearing when I was using the original script from the first post.
Is that possible? I imagine it should be as it is xfce-notifyd element, not pulseaudio.
Offline
Are you using xfce? Have you tried xfce4-volumed? It's located in AUR.
Offline
And how would it help me?
EDIT:
Found the solution. I needed to replace PCM with Master in my original (second) script and voila - it is working with OSD.
Last edited by Lockheed (2011-12-25 20:29:27)
Offline
And how would it help me?
.
Hmm. Well, since xfce4-volumed does provide an on-screen display of volume change and I thought that's what you wanted, I thought it might be worth a try. Anyway, I'm glad you found a solution.
Offline
Hmm. Well, since xfce4-volumed does provide an on-screen display of volume change and I thought that's what you wanted,
Thanks, but I already had a working OSD of volume. Just wanted to make it being displayed.
Offline
Pages: 1