First, the keys need to be recognized. One can set the right keyboard model in /etc/default/console-setup:
XKBMODEL="latitude"Other options can be set also, e.g.:
XKBLAYOUT="us,cz"That ensures that keys are mapped to names like "XF86AudioMute". Names can be used in the menu file, where you put commands for alsamixer to rise/lower the volume. Your menu file could be named .menu/volume-keys (explained in "Debian menu system"):
XKBVARIANT=",qwerty"
XKBOPTIONS="lv3:ralt_switch,grp:alt_shift_toggle,grp:rwin_switch,grp:menu_toggle,grp_led:scroll"
?package(alsa): needs="X11" section="Apps/Sound/Xmms commands" \Run update-menus and refresh your window manager. Finished.
title="Master mute" \
shortcut="XF86AudioMute" \
longtitle="X MultiMedia System" \
command="amixer set Master toggle"
?package(alsa): needs="X11" section="Apps/Sound/Xmms commands" \
title="Master up" \
shortcut="XF86AudioRaiseVolume" \
longtitle="X MultiMedia System" \
command="amixer set Master 5%+"
?package(alsa): needs="X11" section="Apps/Sound/Xmms commands" \
title="Master down" \
shortcut="XF86AudioLowerVolume" \
longtitle="X MultiMedia System" \
command="amixer set Master 5%-"
By choosing the right keyboard model, following lines are applied, which should already be present somewhere in /usr/share/X11/xkb/symbols:
key{ [ XF86AudioMute ] };
key{ [ XF86AudioLowerVolume ] };
key{ [ XF86AudioRaiseVolume ] };
No comments:
Post a Comment