Line 5: | Line 5: | ||
Notice: ''if your window manager evaluates the pressed keycodes, nothing will show up.'' | Notice: ''if your window manager evaluates the pressed keycodes, nothing will show up.'' | ||
The shown keycodes should be placed in <tt>~/.Xmodmap</tt> | The shown keycodes should be placed in <tt>~/.Xmodmap</tt> and loaded on X startup by <tt>xmodmap ~/.Xmodmap</tt>. | ||
Example (ThinkPad X61): | Example (ThinkPad X61): | ||
<source lang="lua"> | <source lang="lua"> | ||
keycode 113 = | keycode 113 = XF86AudioMute | ||
keycode 114 = | keycode 114 = XF86AudioLowerVolume | ||
keycode 115 = | keycode 115 = XF86AudioRaiseVolume | ||
keycode 148 = XF86Launch1 # ThinkVantage Button | |||
keycode 148 = ThinkVantage Button | keycode 163 = XF86AudioNext | ||
keycode 164 = XF86AudioPlay | |||
keycode 163 = | keycode 165 = XF86AudioPrev | ||
keycode 164 = | keycode 166 = XF86AudioStop | ||
keycode 165 = | |||
keycode 166 = | |||
</source> | </source> | ||
Revision as of 20:47, 18 February 2012
Multimedia Keys
We learned that multimedia keys are available by using xev. To use it, start xev | grep keycode and press the buttons in question.
Notice: if your window manager evaluates the pressed keycodes, nothing will show up.
The shown keycodes should be placed in ~/.Xmodmap and loaded on X startup by xmodmap ~/.Xmodmap.
Example (ThinkPad X61):
keycode 113 = XF86AudioMute
keycode 114 = XF86AudioLowerVolume
keycode 115 = XF86AudioRaiseVolume
keycode 148 = XF86Launch1 # ThinkVantage Button
keycode 163 = XF86AudioNext
keycode 164 = XF86AudioPlay
keycode 165 = XF86AudioPrev
keycode 166 = XF86AudioStop
The terminal based program showkeys won’t work, since kernel keycodes differ from X11.
ArchWiki Xmodmap
These keysyms can be used for your favorite window manager‘s configuration.
Example (awesome):
-- Multimedia Keys
awful.key({ }, "XF86AudioRaiseVolume", function () awful.util.spawn('mpc -h localhost volume +1') end),
awful.key({ }, "XF86AudioLowerVolume", function () awful.util.spawn('mpc -h localhost volume -1') end),
awful.key({ }, "XF86AudioMute", function () awful.util.spawn('mpc -h localhost volume 0') end),
awful.key({ }, "XF86AudioNext", function () awful.util.spawn('mpc -h localhost next') end),
awful.key({ }, "XF86AudioPrev", function () awful.util.spawn('mpc -h localhost prev') end),
awful.key({ }, "XF86AudioPlay", function () awful.util.spawn('mpc -h localhost toggle') end)
PulseAudio
PulseAudio is a sound system enabling us to control application volumes individually and use other computers soundcards over the network.
Recommended packages:
- pulseaudio (the daemon, required)
- pavucontrol (GTK based mixer application)
- paprefs (GTK based configuration tool)
Note: in order to discover remote soundcards, one has to start avahi-daemon!