You are not logged in.

#1 2012-05-12 20:44:05

Gullible Jones
Member
Registered: 2004-12-29
Posts: 4,863

acpid and arbitrary keybindings [not possible?]

acpid is really cool; it lets me run a standalone WM on my desktop without having to use sudo for power management. But the netbook has only one suspend button and one power button, and I'd like to be able to manage suspend, hibernate, reboot, and shutdown this way.

Is there a way to bind acpid responses to arbitrary keystrokes, so that I could e.g. reboot with ctrl-alt-delete, or hibernate with ctrl-alt-0?

(Apologies BTW if this has an obvious answer. I did some Googling but didn't find anything.)

Update: from what I've read, it looks like this may not be possible. Too bad... I wonder if there's any other way of binding a keypress to an arbitrary command as root, without invoking sudo.

Last edited by Gullible Jones (2012-05-13 15:49:30)

Offline

#2 2012-05-15 06:39:40

olive
Member
From: Belgium
Registered: 2008-06-22
Posts: 1,490

Re: acpid and arbitrary keybindings [not possible?]

acpid can only respond to acpi events. Normal keystroke are not acpievents. You can bind keyboard keys to command with xbindkeys (your window manager or Desktop might also offer this possibility). Of course these commands must somehow run as root. I think you can use dbus-send if you have the proper dbus authorisation (normally when you are logged locally) but I am not a dbus specialist. Make some research or post a question about dbus specifically.

Last edited by olive (2012-05-15 06:40:42)

Offline

#3 2012-05-15 13:07:46

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,498
Website

Re: acpid and arbitrary keybindings [not possible?]

Have your tried using xmodmap to generate the keycodes from the keys you are missing with other keys. If that fails, xdotool should be able to simulate those key presses, then you can bind an xdotool command to whatever key you want.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#4 2012-05-15 13:26:48

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: acpid and arbitrary keybindings [not possible?]

What is the reason to not want to use sudo?


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

Board footer

Powered by FluxBB