The i3 FAQ has migrated to https://www.reddit.com/r/i3wm/. All content here is read-only.
Ask Your Question
1

Remap power button/key?

asked 2015-03-31 00:12:51 +0000

hes gravatar image

updated 2015-03-31 00:21:52 +0000

I have an Asus UX305 laptop with a power button that is a key on the keyboard, directly above the <backspace> key where <delete> usually is.

In Windows the power options include a setting to disable the power key, in Ubuntu/Gnome it seems to be automatically mapped to a dialog that opens when the power key is hit, giving option of cancel/restart/logout/shutdown.

When running i3 the key simply triggers a shutdown operation with no opportunity for user to intervene. Since this key is right above <backspace> and it's easy to hit accidentally, I want to disable it in i3 or at least map it so that it displays something like I get in Unity/Gnome, avoiding accidental shutdowns.

I tried using 'xev -event keyboard' (while running Unity) to see if I could see what key binding/mapping is being used. The key doesn't trigger a 'key release' event like other keys that would reveal a keycode/keysym.

Can anybody help with a way to do this? Thanks.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2015-03-31 22:12:10 +0000

hes gravatar image

After poking around a bit I found an acceptable way to disable power button, not sure if it's the best method or not. I added this line at the bottom of my i3 config file

unity-settings-daemon

Not sure what directory it's in (one of the libs, I think) but it's on the path somewhere and gets started okay. I had thought this might somehow enable same interactive dialog as I get when I press power button in Unity, but instead it simply does nothing, which is fine.

Has side benefit of brining over some Unity desktop theme settings, not sure what else. In any case seems to be an acceptable solution for now.

edit flag offensive delete link more

Comments

not the answer I would have liked, but it works. Thanks because on laptop you regularly hit the power button by mistake.

Sam73 gravatar imageSam73 ( 2015-08-08 14:55:01 +0000 )edit

Question Tools

Stats

Asked: 2015-03-31 00:12:51 +0000

Seen: 423 times

Last updated: Mar 31