View previous topic :: View next topic |
Author |
Message |
sonicbhoc Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/19626066624403a4096a7e1.gif)
Joined: 24 Oct 2005 Posts: 1805 Location: In front of the computer screen
|
Posted: Sun Jun 10, 2007 12:27 pm Post subject: ACPI events and extra buttons |
|
|
Well, I brought the Madtux High Performance Laptop, which is pretty much a re-branded Asus laptop (but I don't know which model). So, whenever I press one of the special FN key combinations (the ones for volume and media player control), or the 4 extra buttons on the top (help, internet, mail, and something else) I get this message in my system logs:
Code: |
ACPI group hotkey / action ATKD is not defined |
I also get this message when I close my lid or press the sleep button. How do I define these? _________________ I'm too lazy to keep this stupid signature up to date, so here's something more interesting:
My friend Hetdegon can draw if you ask me.
Now using PClinuxOS on my laptop and Gentoo on my desktop and new laptop. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
sonicbhoc Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/19626066624403a4096a7e1.gif)
Joined: 24 Oct 2005 Posts: 1805 Location: In front of the computer screen
|
Posted: Tue Jun 12, 2007 2:44 pm Post subject: |
|
|
*bumpity bump bump* _________________ I'm too lazy to keep this stupid signature up to date, so here's something more interesting:
My friend Hetdegon can draw if you ask me.
Now using PClinuxOS on my laptop and Gentoo on my desktop and new laptop. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
hans0r Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/12116763946ea540756097.jpg)
Joined: 02 Jan 2005 Posts: 122 Location: Germany
|
Posted: Tue Jun 12, 2007 4:35 pm Post subject: |
|
|
i'm too lazy to write a complete guide.
google for: asus acpid |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
sonicbhoc Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/19626066624403a4096a7e1.gif)
Joined: 24 Oct 2005 Posts: 1805 Location: In front of the computer screen
|
Posted: Tue Jun 12, 2007 11:42 pm Post subject: |
|
|
Well, whaddaya know? It's the first link too. Thanks a lot! _________________ I'm too lazy to keep this stupid signature up to date, so here's something more interesting:
My friend Hetdegon can draw if you ask me.
Now using PClinuxOS on my laptop and Gentoo on my desktop and new laptop. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
sonicbhoc Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/19626066624403a4096a7e1.gif)
Joined: 24 Oct 2005 Posts: 1805 Location: In front of the computer screen
|
Posted: Wed Jun 13, 2007 1:05 am Post subject: |
|
|
I've hit a snag with the mute button: this person is using aumix and I'm using amixer. The output from amixer looks like this:
Code: | Simple mixer control 'PCM',0
Capabilities: pvolume
Playback channels: Front Left - Front Right
Limits: Playback 0 - 255
Mono:
Front Left: Playback 0 [0%] [-51.00dB]
Front Right: Playback 0 [0%] [-51.00dB]
|
Now, I'm trying to make a mute script that will check to see if the volume is 0, whether it's through Playback 0, 0% or -51.00dB.
So far, all of these have failed. Trying to determine the volume level from grepping "Playback 0" I always get returned the line Limits: Playback 0.
Trying to grep 0% doesn't work because there is a 0% in 0% and 100%, so that doesn't work either.
Trying to grep -51.00dB (with or without quotes) makes grep print "Invalid option: -- ."
How do I determine whether the volume is 0% or not? If I can determine whether the volume is 0 I can finish the rest of the script my mute script myself. The rest of this stuff is going swimmingly, though. _________________ I'm too lazy to keep this stupid signature up to date, so here's something more interesting:
My friend Hetdegon can draw if you ask me.
Now using PClinuxOS on my laptop and Gentoo on my desktop and new laptop. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
hans0r Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/12116763946ea540756097.jpg)
Joined: 02 Jan 2005 Posts: 122 Location: Germany
|
Posted: Wed Jun 13, 2007 1:08 am Post subject: |
|
|
grep "\-51.00dB" should work
or grep "\[0%" |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
sonicbhoc Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/19626066624403a4096a7e1.gif)
Joined: 24 Oct 2005 Posts: 1805 Location: In front of the computer screen
|
Posted: Wed Jun 13, 2007 2:22 am Post subject: |
|
|
Thanks! I'm so close I can smell it!
Now, there's just one last problem, that I think might get a little difficult:
the buttons for play/pause, stop, next song and previous song. I use KDE, so I use amarok as my default player. I know I can control amarok through dcop, which is a cool little tool by the way. So, all of the other buttons I've set up work. But, these four don't because I have them using dcop to control amarok.
Unfortunately, when I try it, I get this error: "Could not connect to DCOP server!"
Which makes sense, because these scripts are being run as root, while dcop is being run as me. So, what do I do?
I can't do amarok -f because then it starts Amarok as root, which is useless...
Once I get this sorted out, I'll be set.
Of course, all of these events are being run as root, so the quick buttons are useless because they'd run all of the programs I want them to run (konqueror, dolphin, konsole and firefox) as root, which is completely useless. Any way to get all of these buttons to run as a user instead of root as well? _________________ I'm too lazy to keep this stupid signature up to date, so here's something more interesting:
My friend Hetdegon can draw if you ask me.
Now using PClinuxOS on my laptop and Gentoo on my desktop and new laptop. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
hans0r Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/12116763946ea540756097.jpg)
Joined: 02 Jan 2005 Posts: 122 Location: Germany
|
Posted: Wed Jun 13, 2007 4:27 am Post subject: |
|
|
well, this is nicest way (and most complicated way) to assign these keys... and forces my lazy ass to write a quick and dirty howto
maybe i'll write a full howto with proper explanations of each step someday.
get http://sunsite.mff.cuni.cz/pub/debian/pool/main/a/acpi-support/acpi-support_0.90.orig.tar.gz and unpack it.
edit acpi_fakekey.c and change
Code: |
for (i=0; i<32; i++) {
|
to
Code: |
for (i=4; i<32; i++) {
|
type make and copy acpi_fakekey to e.g. /usr/local/bin
copy all the asus files from the events folder to /etc/acpi/events
copy all the files ending with .sh to /etc/acpi (or only those that are needed by the asus events) and make sure they are executable (chmod +x)
mkdir /usr/share/acpi-support and copy key-constants there
edit/create .Xmodmap in your home folder and add the following
Code: |
keycode 160 = XF86AudioMute
keycode 174 = XF86AudioLowerVolume
keycode 176 = XF86AudioRaiseVolume
keycode 236 = XF86Mail
keycode 178 = XF86WWW
keycode 162 = XF86AudioPlay
keycode 164 = XF86AudioStop
keycode 144 = XF86AudioPrev
keycode 153 = XF86AudioNext
|
create a file in ~/.kde/Autostart/xmodmap
Code: |
#!/bin/sh
xmodmap ~/.Xmodmap
|
make it executable and run it once
so, that's about it. all the keys should generate proper key-events now and can be assigned to shortcuts in kde.
the volume-keys should work even without assigning them, and even with a nice osd. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
sonicbhoc Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/19626066624403a4096a7e1.gif)
Joined: 24 Oct 2005 Posts: 1805 Location: In front of the computer screen
|
Posted: Wed Jun 13, 2007 12:06 pm Post subject: |
|
|
hans0r wrote: |
edit acpi_fakekey.c and change
Code: |
for (i=0; i<32; i++) {
|
to
Code: |
for (i=4; i<32; i++) {
|
|
This is the only thing I have a question about: what does this do?
Also, how can I be sure that the keycodes won't overwrite other existing keycodes? _________________ I'm too lazy to keep this stupid signature up to date, so here's something more interesting:
My friend Hetdegon can draw if you ask me.
Now using PClinuxOS on my laptop and Gentoo on my desktop and new laptop. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
sonicbhoc Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/19626066624403a4096a7e1.gif)
Joined: 24 Oct 2005 Posts: 1805 Location: In front of the computer screen
|
Posted: Wed Jun 13, 2007 3:02 pm Post subject: |
|
|
It didn't work! I'm pretty sure I followed your instructions to a tee. However, none of the keys give keycodes at all! There weren't any errors in compilation, I can run acpi_fakekey (although it does nothing) and all of the scripts and events are in the right place. I double-checked the keycodes, and they were right. The scripts seem to be right too, but nothing is happening. I'd like for this to work right! _________________ I'm too lazy to keep this stupid signature up to date, so here's something more interesting:
My friend Hetdegon can draw if you ask me.
Now using PClinuxOS on my laptop and Gentoo on my desktop and new laptop. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
hans0r Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/12116763946ea540756097.jpg)
Joined: 02 Jan 2005 Posts: 122 Location: Germany
|
Posted: Fri Jun 15, 2007 3:24 pm Post subject: |
|
|
sonicbhoc wrote: |
This is the only thing I have a question about: what does this do?
|
iirc a newer kernel version changed the order of the /dev/input/event? device nodes. that confused acpi_fakekey, so that line had to be edited.
maybe your system doesn't need it.
sonicbhoc wrote: |
I can run acpi_fakekey (although it does nothing) |
it doesn't give any output, neither when it runs successfully nor when it fails.
also it needs to be run it as root.
to test if it works you can try "acpi_fakekey 10". that's the key event for 9.
it should look like this:
Code: |
kellerkind ~ # acpi_fakekey 10
kellerkind ~ # 9
|
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
sonicbhoc Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/19626066624403a4096a7e1.gif)
Joined: 24 Oct 2005 Posts: 1805 Location: In front of the computer screen
|
Posted: Sun Jun 17, 2007 1:01 am Post subject: |
|
|
I knew something was up... nothing happened! _________________ I'm too lazy to keep this stupid signature up to date, so here's something more interesting:
My friend Hetdegon can draw if you ask me.
Now using PClinuxOS on my laptop and Gentoo on my desktop and new laptop. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|