I set my displays to sleep with xset dpms force off after locking the screen with kscreenlock. This is great, the displays wake up when the mouse is moved (by me, air, the cat). I'd like to set it in a way that only the keyboards can wake up the screens again.

Is there some way to do this for the KDE screen locker or in general?


1 Answer 1


First use xinput list to get the device ID for your mouse, and then use

xinput --set-prop [ID#] "Device Enabled" "0"


xinput --set-prop [ID#] "Device Enabled" "1"

to disable and enable the mouse.


  • I wrote a short script using this advice and the OP's xset xdpms force off, bound it to a key using xbindkeys. I just wanted to note something that took me a while to realize: xbindkeys lets you bind a command to keyrelease, via a virtual "release" modifier: (xbindkey '(release Scroll_Lock) "my-x11-sleep-script"). With an ordinary binding the keyrelease would wake up the display again. Sep 25, 2018 at 18:42

Not the answer you're looking for? Browse other questions tagged .