Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

1 Answer 1

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
1  
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 at 3:14

Your Answer

 
discard

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.