Do I need to install an additional program to make multimedia keys available?
by NuttyJamie from LinuxQuestions.org on (#5EEJG)
Hello all!
I was confused whether to post this question on the software forum or on the hardware forum and finally decided to post it here. So please forgive me if my decision is wrong. :scratch:
I'm using Slackware64-current on Thinkpad T420 which has several multimedia key.
I have confirmed that these multimedia keys work well with KDE plasma or M$ Windows 10. I mean it's not broken.
But I want to use suckless's dwm, so I searched a lot and found some ways.
Since I had used xmodmap briefly before, I ran xev to modify the keycode. And pushed the mute button, then:
Code:$ xev
...
KeyRelease event, serial 32, synthetic NO, window 0x4c00001,
root 0x57a, subw 0x0, time 4661262, (584,345), root:(586,365),
state 0x0, keycode 121 (keysym 0x1008ff12, XF86AudioMute), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: FalseThe correct keysym was already specified.
Pasting "keycode 121 = XF86AudioMute" to ~/.Xmodmap and running "xmodmap ~/.Xmodmap" was nothing happend. No change. No error.
I also read about acpi, so I ran acpi_listen, then pushed those volume control keys, the results were as follows.Code:$ acpi_listen
button/mute MUTE 00000080 00000000 K
button/volumedown VOLDN 00000080 00000000 K
button/volumeup VOLUP 00000080 00000000 K
button/f20 F20 00000080 00000000 K
^CIsn't it being recognized? Or is there something wrong with it?
Should I install a program called xbindkey from Slackbuilds?
And I use the Colemak layout, can this be a hint for solving the problem?
Here's my .xinitrc:Code:$ cat ~/.xinitrc
#!/bin/sh
#Enable colemak layout
#https://colemak.com/Unix
setxkbmap us -variant colemak && xset r 66
#Change Caps_Lock(Backspace in colemak) to Ctrl
setxkbmap -option ctrl:nocaps
userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap
# merge in defaults and keymaps
if [ -f $sysresources ]; then
xrdb -merge $sysresources
fi
if [ -f $sysmodmap ]; then
xmodmap $sysmodmap
fi
if [ -f $userresources ]; then
xrdb -merge $userresources
fi
if [ -f $usermodmap ]; then
xmodmap $usermodmap
fi
ibus-daemon &
export GTK_IM_MODULE=ibus
export XMODIFIERS=@im=ibus
export QT_IM_MODULE=ibus
export XIM_PROGRAM=/usr/bin/ibus
#Start X Window Manager
exec dwmIt is so uncomfortable to leave the spare terminal on and adjust the volume with the alsamixer every time. :doh:
Feel free to let me know if you need any information to solve the problem. I'll do my best to cooperate. Thank you for any help.


I was confused whether to post this question on the software forum or on the hardware forum and finally decided to post it here. So please forgive me if my decision is wrong. :scratch:
I'm using Slackware64-current on Thinkpad T420 which has several multimedia key.
I have confirmed that these multimedia keys work well with KDE plasma or M$ Windows 10. I mean it's not broken.
But I want to use suckless's dwm, so I searched a lot and found some ways.
Since I had used xmodmap briefly before, I ran xev to modify the keycode. And pushed the mute button, then:
Code:$ xev
...
KeyRelease event, serial 32, synthetic NO, window 0x4c00001,
root 0x57a, subw 0x0, time 4661262, (584,345), root:(586,365),
state 0x0, keycode 121 (keysym 0x1008ff12, XF86AudioMute), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: FalseThe correct keysym was already specified.
Pasting "keycode 121 = XF86AudioMute" to ~/.Xmodmap and running "xmodmap ~/.Xmodmap" was nothing happend. No change. No error.
I also read about acpi, so I ran acpi_listen, then pushed those volume control keys, the results were as follows.Code:$ acpi_listen
button/mute MUTE 00000080 00000000 K
button/volumedown VOLDN 00000080 00000000 K
button/volumeup VOLUP 00000080 00000000 K
button/f20 F20 00000080 00000000 K
^CIsn't it being recognized? Or is there something wrong with it?
Should I install a program called xbindkey from Slackbuilds?
And I use the Colemak layout, can this be a hint for solving the problem?
Here's my .xinitrc:Code:$ cat ~/.xinitrc
#!/bin/sh
#Enable colemak layout
#https://colemak.com/Unix
setxkbmap us -variant colemak && xset r 66
#Change Caps_Lock(Backspace in colemak) to Ctrl
setxkbmap -option ctrl:nocaps
userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap
# merge in defaults and keymaps
if [ -f $sysresources ]; then
xrdb -merge $sysresources
fi
if [ -f $sysmodmap ]; then
xmodmap $sysmodmap
fi
if [ -f $userresources ]; then
xrdb -merge $userresources
fi
if [ -f $usermodmap ]; then
xmodmap $usermodmap
fi
ibus-daemon &
export GTK_IM_MODULE=ibus
export XMODIFIERS=@im=ibus
export QT_IM_MODULE=ibus
export XIM_PROGRAM=/usr/bin/ibus
#Start X Window Manager
exec dwmIt is so uncomfortable to leave the spare terminal on and adjust the volume with the alsamixer every time. :doh:
Feel free to let me know if you need any information to solve the problem. I'll do my best to cooperate. Thank you for any help.