Ubuntu – How to disable the sleep button on the keyboard

power-managementshortcut-keys

I have a "power button" on my keyboard that enables standby or hibernate. I can't find the mapping of this key anywhere in "sytem settings>Keyboard", "system>power management", "compiz config> or similar (where I could find it before unity). How can I disable (not remap) this button?

I do not want to disable hibernate/sleep altogether, it's simply this key that gets pressed a lot by accident and it's getting quite annoying.

Best Answer

Disable the suspend button in your system

gsettings set org.gnome.settings-daemon.plugins.power button-suspend "nothing"

Revert to the default value

gsettings set org.gnome.settings-daemon.plugins.power button-suspend "suspend"

Disable the sleep button in your system

gsettings set org.gnome.settings-daemon.plugins.power button-sleep "nothing"

Revert to the default value

gsettings set org.gnome.settings-daemon.plugins.power button-sleep "hibernate"

Disable the hibernate button in your system

gsettings set org.gnome.settings-daemon.plugins.power button-hibernate "nothing"

Revert to the default value

gsettings set org.gnome.settings-daemon.plugins.power button-hibernate "hibernate"

Settings those options above does not disable the functions in your system, you can still use the cog wheel menu to hibernate / suspend, this only disables keyboard and other buttons you might have in your computer.

Related Question