ALSA and xmms are a little more complicated because they have no shortcut settings.
So I wrote a few shell scripts for the actions and configured my window manager to
assign short cuts to these shell scripts.
ALSA
I wanted to mute LineIn without using kmix or similar.
The following shell-script toggles mute on LineIn in my second sound card:
#!/bin/sh
state=`amixer -c 1 get Line,0 | tail -1 | gawk '{print $6}'`
if [ $state = "[on]" ];
then amixer -c 1 sset Line,0 mute;
else amixer -c 1 sset Line,0 unmute;
fi
In KDE you add this script (say linein_toggle_mute.sh) to the Start-Menu and then
assign a short cut to it. In enlightenment I added the following lines in
my keybindings.cfg:
__NEXT_ACTION
__KEY XF86AudioMute
__EVENT __KEY_PRESS
__ACTION __A_EXEC /etc/alsa/scripts/line_toggle_mute.sh
Another thing for me was to easily toggle the capturing device from microphone
to line in. The following script does this and opens a window in X that
tells you which one is set at the moment:
#!/bin/sh
state=`amixer -c 1 get Mic,0 | tail -1 | gawk '{print $4}'`
if [ $state = "[on]" ];
then amixer -c 1 sset Line,0 cap;
xmessage -center -timeout 1 "Capture-Device: Line in"
else amixer -c 1 sset Mic,0 cap;
xmessage -center -timeout 1 "Capture-Device: Microphone";
fi
Again I assigned a key to this shell-scipt (like above).
Remember: "-c 1" means for card two (!). Change this to the correct
soundcard for you or leave it out if you only have one.
XMMS
XMMS creates a socket and there is a shell command (xmms-shell) from where
you can (remote) control xmms.
I wrote a few shell scripts for play/pause/stop/backword/forward/volume.
You can
download them and
place them for example in /etc/xmms/scripts/ and assign like above keyboard
shortcuts to them.