controlling volume from command line

Patrick Nagel mail at patrick-nagel.net
Tue Nov 18 02:51:24 GMT 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

D. R. Evans wrote:
> For years I have used the command:
>   dcop kmix Mixer0 setVolume 0 0
> to set volume to zero.
> 
> How do I do this in KDE4 (specifically, Kubuntu 8.10)?

I bound the following shell script to the Mute button of my laptop (with
xbindkeys):

#!/bin/bash

STATE=$( amixer -c 0 sget 'Master' | tail -n 1 | cut -d' ' -f8 )

case "${STATE}" in

( "[on]" ) # Un-muted
        amixer -c 0 -q sset 'Master' off
        echo "Mute ON"
        kdialog --passivepopup "Mute ON" 2 2>/dev/null &
;;

( "[off]" ) # Muted
        amixer -c 0 -q sset 'Master' on
        echo "Mute OFF"
        kdialog --passivepopup "Mute OFF" 2 2>/dev/null &
;;

esac

- --
Key ID: 0x86E346D4            http://patrick-nagel.net/key.asc
Fingerprint: 7745 E1BE FA8B FBAD 76AB 2BFC C981 E686 86E3 46D4
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkkiLawACgkQyYHmhobjRtRP8QCfbVZMnVa0RVAHbGugiNLHP9OE
RZ0An1GxpBfUh+gH4ntw+3KbFk/erhjY
=xkAb
-----END PGP SIGNATURE-----
___________________________________________________
This message is from the kde mailing list.
Account management:  https://mail.kde.org/mailman/listinfo/kde.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.html.




More information about the kde mailing list