KeyPress event, serial 30, synthetic NO, window 0x1c00001, root 0xdb, subw 0x0, time 1660226276, (89,82), root:(1690,103), state 0x0, keycode 235 (keysym 0x0, NoSymbol), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False KeyRelease event, serial 30, synthetic NO, window 0x1c00001, root 0xdb, subw 0x0, time 1660226338, (89,82), root:(1690,103), state 0x0, keycode 235 (keysym 0x0, NoSymbol), same_screen YES, XLookupString gives 0 bytes:The entry of interest for us is "keycode 235". Write them down and remember for which key it was (play, pause, the little ugly house-key).
keycode 160=XF86AudioMute keycode 144=XF86AudioPrev keycode 164=XF86AudioStop keycode 162=XF86AudioPlay keycode 153=XF86AudioNext keycode 174=XF86AudioLowerVolume keycode 176=XF86AudioRaiseVolume keycode 236=XF86Mail keycode 178=XF86HomePage keycode 227=XF86Start keycode 161=XF86Search keycode 234=XF86Back keycode 231=XF86AudioRecordYou can test this with
xmodmap xmodmaprcStart "xev" again and check if the keysym is shown next to the keycode:
keycode 234 (keysym 0x1008ff26, XF86Back)
exec xmodmap /etc/X11/Xmodmaprc &(do not forget the &, otherwise your wm will not start)
xmodmap -pk
__NEXT_ACTION __KEY XF86Search __EVENT __KEY_PRESS __MODIFIER_KEY __ALT __ACTION __A_EXEC /usr/bin/firefoxAmarok is quite simple: Settings -> Configure global shortcuts, just use the keys.
#!/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; fiIn 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.shAnother 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"; fiAgain I assigned a key to this shell-scipt (like above).