GNOME Bugzilla – Bug 324124
Power and sleep button should be recognized
Last modified: 2020-11-06 20:14:15 UTC
In the current version the capplet doesn't recognize if I push the power button or the sleep button of my laptop. HAL does recognize them. So I guess we should link the keybindings capplet to HAL to also recognize these buttons. Furthermore we can then have the Power button default to the Gnome logout dialog and the sleep button to the suspend action
I can confirm this bug. See the launchpad bug: <a href="https://launchpad.net/products/gnome-power/+bug/57872">57872</a>
This is now fixed in Ubuntu through editing a patch. Was this really upstream or Ubuntu-only?
This particular bug was an Ubuntu-only problem. Please close as INVALID. Thanks, Simon
I don't agree. In ubuntu (and also gnome in general) the power buttons are recognized by gnome-power-manager. In my opinion the keybindings capplet should be responsible for setting all buttons
Those buttons don't go through the input layer on Linux, but should soon[1]. When those do, then X can capture them, and gnome-power-manager can act upon them, and could even install a keybindings .xml file to allow the keyboard shortcuts capplet to configure those buttons (ie. if one wants Ctrl+Alt+Del instead of the power button to go to sleep...). Moving to gnome-power-manager. [1]: See http://lists.freedesktop.org/archives/hal/2006-February/004638.html and the associated work on lkml.
g-p-m already grabs the xkeys when you compile --with-xevents, but i'm interested in the keybindings xml file. Do you have any more data about this, or any examples? Thanks.
Bug #410758, and control-center trunk has a bunch of examples. Copy one of the .xml files (which I should really document...), and tweak it to your liking. It will end up showing up in the GNOME keyboard shortcuts. If it's really not clear, I'll file a bug against myself to write the docs :)
Dude, if g-s-d gets the X keypress, how does it tell g-p-m to do the actions? Do you want to fire off a method on org.freedesktop.PowerManagement.Key("brightness-up") or am i missing a trick? Richard
The only thing dropping that .xml file does, is to provide a UI to set a particular GConf key, nothing else. Then you can use a piece of code like tomboykeybinder.[ch] in g-p-m directly, or probably easier, add the keys as handled in gnome-settings-daemon, and make them call g-p-m via d-bus.
Bastien made a wiki page describing what to do. http://live.gnome.org/ControlCenter/ApplicationDefinedKeybindings I guess we can add this for 2.22
bugzilla.gnome.org is being replaced by gitlab.gnome.org. We are closing all old bug reports in Bugzilla which have not seen updates for many years. If you can still reproduce this issue in a currently supported version of GNOME (currently that would be 3.38), then please feel free to report it at https://gitlab.gnome.org/GNOME/gnome-power-manager/-/issues/ Thank you for reporting this issue and we are sorry it could not be fixed.