You are not logged in.
Pages: 1
Sorry if this seems like a repeated topic, but I have tried a number of solutions before putting up this post. I have gut feeling that the problem is realted to a conflict of some package with acpid.
My Handler file:
#!/bin/bash
# Default acpi script that takes an entry for all actions
case "$1" in
button/power)
case "$2" in
PBTN|PWRF)
logger 'PowerButton pressed'
;;
*)
logger "ACPI action undefined: $2"
;;
esac
;;
video/brightnessup)
case "$2" in
BRTUP)
logger 'Increase Brightness'
sleep 1; /usr/bin/xset dpms force off
;;
BRTDN)
logger 'Reduce Brightness'
;;
*)
logger "ACPI action undefined: $2"
;;
esac
;;
esacThis file is me just trying to get something to work, so that I can use acpid events for various functions.
All I am trying to do is to map special keys registered as ACPI events to their specific handlers. Eg: Brightness Up/Down, Volume Up/Down
I can see all functions being registeres through acpi_listen:
[user@pc ~]$ acpi_listen
video/brightnessdown BRTDN 00000087 00000000
video/brightnessup BRTUP 00000086 00000000
button/mute MUTE 00000080 00000000 K
button/volumedown VOLDN 00000080 00000000 K
button/volumeup VOLUP 00000080 00000000 KThe Box:
[user@pc ~]$ uname -a
Linux boolean-pc 4.4.39-1-lts #1 SMP Thu Dec 15 21:10:18 CET 2016 x86_64 GNU/LinuxI had earlier (a lot of months back before systmed came into existence) streamlined these operations on my laptop. A few months back my laptop also changed and with systemd coming into existence the interaction with acpi has become slightly troublesome. I have gone through the systemd and acpi pages on arch wiki.
Please advice!
Offline
As the wiki would have told you, commands like "xset" rely on several variables which are available to the acpid process.
Mods are just community members who have the occasionally necessary option to move threads around and edit posts. -- Trilby
Offline
As the wiki would have told you, commands like "xset" rely on several variables which are available to the acpid process.
Frankly, I overlooked this part of the article. Does this mean that the XDisplay has to be defined within the handler script?
The wiki has a link to an example function within xinitrc. Would this same work with the handler script?
Last edited by theta (2016-12-24 19:44:33)
Offline
The wiki has a link to an example function within xinitrc.
It's not within xinitrc... it's meant to be used together with .xinitrc (i.e., it probably wouldn't work if you use a display manager). The code itself goes in the handler script.
Last edited by Alad (2016-12-24 20:36:02)
Mods are just community members who have the occasionally necessary option to move threads around and edit posts. -- Trilby
Offline
The wiki has a link to an example function within xinitrc.
It's not within xinitrc... it's meant to be used together with .xinitrc (i.e., it probably wouldn't work if you use a display manager). The code itself goes in the handler script.
I am not getting the hang of the above. Do you mean the getXuser function would work within the handler.sh script?
Also I somehow realized that my Volume Multimedia keys are working. When I tried to manipulate them using the handler script (by changing the amount of increase percentage in volume), I found that its not really being controlled by acpid.
This implies that something else in the system is causing the Volume Multemedia keys to work out of the box. Leading to more confusion.
Using xev and the list at /usr/include/X11/XF86keysym.h, I have verified that the scan codes are correct and matching.
Offline
For handling keystrokes, sxhkd works great. I switched to it, as a lightweight replacement to xbindkeys.
Offline
For handling keystrokes, sxhkd works great. I switched to it, as a lightweight replacement to xbindkeys.
Thing with sxhkd or anything using X is that it stops working when something grabs the keys, e.g. a screensaver or full screen application.
This implies that something else in the system is causing the Volume Multemedia keys to work out of the box. Leading to more confusion.
Depends on what you have installed. Most of the desktop environments have some mechanism in place, for example.
I am not getting the hang of the above. Do you mean the getXuser function would work within the handler.sh script?
I failed to notice there's no more getXuser function... you'd put the snippet in your handler to export the needed variables (USER, DISPLAY and XAUTHORITY) then run your programs like so:
sudo -u "$USER" fooappMods are just community members who have the occasionally necessary option to move threads around and edit posts. -- Trilby
Offline
Thing with sxhkd or anything using X is that it stops working when something grabs the keys, e.g. a screensaver or full screen application.
Screensaver yes, but sxhkd works fine with full-screen games in my experience. I use XFCE.
Offline
For handling keystrokes, sxhkd works great. I switched to it, as a lightweight replacement to xbindkeys.
Sounds like a decent alternative. Will give it a shot.
Depends on what you have installed. Most of the desktop environments have some mechanism in place, for example.
I have openbox with sddm. My system is extremely custom configured, to the extent I forget sometimes what all I have done. Its been built up since back in 2008. So I am doubtful as to what would cause the Multemedia Keys to work.
Offline
I have openbox with sddm. My system is extremely custom configured, to the extent I forget sometimes what all I have done. Its been built up since back in 2008. So I am doubtful as to what would cause the Multemedia Keys to work.
Ok I just realized that I had configured openbox to use the Volume buttons. Verified it. I should probably do the same for the brightness buttons.
PS: Any suggestions for overlays to use with openbox
Offline
Pages: 1