Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I recently installed Ubuntu 13.04.

I changed my shortcut for "Lock screen" to the sleep button on my keyboard.

But instead of just locking the screen it puts my computer into hibernation/suspend mode, which is kind of annoying. I can't find where the hibernation mode is bound to the sleep button.

I already tried gsettings set org.gnome.settings-daemon.plugins.power button-sleep 'nothing' (as mentioned here) but it doesn't affect the sleep button and it still goes into hibernation/suspend.

Can you help me?

share|improve this question
up vote 1 down vote accepted

I had to disable suspend button (button-suspend):

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

But then the sleep/suspend button did nothing at all, even with the system shortcut, so I had to utilize the CompizConfig Settings Manager: Commands > Enable commands.

I added following for command line 0: gnome-screensaver-command -l. Then I switched to the tab "Key Bindings" and grabbed my key for command 0. (It is set to XF86Sleep now).

Everything works as expected now.

share|improve this answer
Everything worked for me in 14.04 except I can't get regular XF86Sleep to bind (even after changing the config setting to 'nothing'). However I was able to bind Alt+XF86Sleep. Also, I wanted it to lock the screen and turn off the monitor, so I used gnome-screensaver-command -l; xset dpms force off. – Toby J Apr 18 '14 at 3:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.