pin Don't care. Mediakeys are assigned:
I will also just bind X multimedia keys to mixerctl commands. In ctwm(1) this can be achieved with:
# Volume keys
"XF86AudioLowerVolume" = : all : f.exec "mixerctl -w outputs.master2-=3,3 ; sh bindir/vol"
"XF86AudioRaiseVolume" = : all : f.exec "mixerctl -w outputs.master2+=3,3 ; sh bindir/vol"
"XF86AudioMute" = : all : f.exec "mixerctl -w outputs.master2.mute=on ; sh bindir/vol"
# Multimedia Keys
"XF86AudioPlay" = : all : f.exec "mpc play > /dev/null 2>&1 ; sh bindir/mpdnotify"
"XF86AudioStop" = : all : f.exec "mpc pause > /dev/null 2>&1 ; notify-send 'playback stopped'"
"XF86AudioPrev" = : all : f.exec "mpc prev > /dev/null 2>&1 ; sh bindir/mpdnotify"
"XF86AudioNext" = : all : f.exec "mpc next > /dev/null 2>&1 ; sh bindir/mpdnotify
As, you can see XF86Audio[Lower|Raise|Mute] not only change/mute volume, bu will also execute the script I posted above, which sends me a desktop notification with the current volume level.
XF86Audio[Play|Stop|Prev|Next] on the other hand, are bound to audio/mpc commands. Any of these keys will also execute the mpdnotify
script, which notifies me of any song change.
I also use this volume.sh script to easily change volume from command line:
#!/bin/sh
device=outputs.master
inc=10
volume=`mixerctl $device | cut -d "," -f 2`
X=0
case $1 in
- )
X=$((${volume} - ${inc}))
mixerctl -w $device=$X,$X 2>/dev/null;;
+ )
X=$((${volume} + ${inc}))
mixerctl -w $device=$X,$X 2>/dev/null;;
0 )
if [ ${volume} != "0" ]; then
mixerctl -w $device=0,0
else
mixerctl -w $device=208,208
fi
;;
esac
~ $ volume.sh +
outputs.master: 174,174 -> 184,184
~ $ volume.sh -
outputs.master: 184,184 -> 174,174
~ $ m bin/volume.sh
~ $ volume.sh 0
outputs.master: 174,174 -> 0,0