Sleep Button in KDE 4 Workaround
If you noticed that pushing the sleep button does nothing in KDE 4 (as of this writing <=4.3.3), this is because of a bug in KDEs’ power management tool Powerdevil. It appears that in most cases Powerdevil does not recognize the Xorg servers’ XF86Sleep key. To fix this, you may be able to rebind the sleep key in the KDE control panel.
Add a New Input Action
Open System Settings then Input Actions. Then add a new Global Shortcut:
Name it ‘Sleep’ or whatever you like. Add a Comment if you wish and in the Trigger tab select your hotkey. Try setting the sleep key first. For me, setting the hotkey to the sleep key didn’t work because I believe that Powerdevil already has it bound. There have been others though that look to have sucessfully done so.
I bound mine to Scroll Lock (hope I don’t need it anytime soon) then in the Action tab entere the dbus command to suspend to ram:
qdbus org.kde.kded /modules/powerdevil suspend 2
If this doesn’t work, try ‘suspend 1’. If you would like to suspend to disk:
qdbus org.kde.kded /modules/powerdevil suspend 4