[SOLVED] Do I need to install an additional program to make multimedia keys available?
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Do I need to install an additional program to make multimedia keys available?
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.
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: False
The 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
^C
Isn'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 dwm
It is so uncomfortable to leave the spare terminal on and adjust the volume with the alsamixer every time.
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.
You can see here two ways to do volume up and down - using amixer and using pactl. I added the ones with pactl because it goes above 100% which is useful when the volume is low. I don't remember why I have two versions for mute as well. The
Code:
&& pkill -SIGRTMIN+10 i3blocks
parts are to signal the change to i3bar to update the display, so probably not relevant for you, and the
I don't actually use dwm, but IIRC it doesn't bind these keys by default and you're supposed to edit its source and re-compile to do so. From the Gentoo wiki (note that "re-emerge" involves recompiling)
I don't know how you do it in suckless, but using i3wm I need to tell i3 what to do with these keys.
...
Oh, Then is the dwm blocking the communication between me and the kernel? I don't know what to do right now, but I think it will be an important clue. I'll find a way to apply it to the dwm. Thank you very much.
I don't actually use dwm, but IIRC it doesn't bind these keys by default and you're supposed to edit its source and re-compile to do so. From the Gentoo wiki (note that "re-emerge" involves recompiling)
You could also set up something like Xbindkeys
Oh, those lovely Gentoo guys.
Thank you so much. I think the problem is almost solved.
It's late at night here, so I'll try tomorrow and report my progress.
Last edited by NuttyJamie; 02-20-2021 at 01:31 PM.
You can also use the SHCMD macro if you need to do something more complicated, e.g. a pipeline to parse output.
Here is an example from mine using the SHCMD macro which keeps the volume level in a /tmp/volume file which my status bar reads:
I was just too curious about the results, so I kicked out the duvet and then just re-compiled the config.h source as I saw on Gentoo Wiki a few minutes ago, and it worked out perfectly.
Thank you so much, nivieru, xor_ebx_ebx, and Loomx. Thank you so much Gentoo guys.
Quote:
Originally Posted by Loomx
Have a look in the dwm file config.def.h for how it links keys to actions. There are a couple of ways to do it.
...
Also see the (quite old) tutorial in my signature.
Not only did I get the idea I needed to solve the problem, I could even learn how to apply it in a complex way.
Thank you again
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.