How do I disable the sleep button on my keyboard?

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.


Dconf Editor is the recommend replacment to gconf editor for Unity. You can get dconf in the software center or by typing sudo apt-get install dconf-tools in the terminal.

With Dconf editor, navigate to org gnome settings-daemon plugins power. There you can change what the sleep button does, as well as many other buttons on your keyboard.

enter image description here


Have you also tried this one?

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

I did all 3 from the linked-to question and it fixed this for me (x86 on 12.04).

EDIT: Here's a single command that does all 3:

for x in button-{suspend,sleep,hibernate}; do 
  gsettings set org.gnome.settings-daemon.plugins.power $x "nothing";
done