7

I can blank/turn off display on my laptop with following command:

xset dpms force off

then, any mouse movement or keyboard press "wakes up" the display.

Is it possible to ignore mouse movements, and only unblank the screen on keyboard action?

If this is not possible in xset at the moment, I would welcome any suggestion how to patch the sourcecode.

I am using Debian 10.

400 the Cat
  • 819
  • 4
  • 37
  • 85

2 Answers2

4

A work around could be having a service running xset q to determine whether monitor is on/off. If off, disable mouse/touchpad and if on enable it back again.

To enable/disable first get your mouse/touchpad id with

xinput -list

Then use

xinput --disable <device>

Service should run something like this:

#!/bin/bash
while true; do
    status="$(xset q)"
    if [[ $status == *"Monitor is On"* ]]; then
        xinput --enable <device>
    fi

    if [[ $status == *"Monitor is Off"* ]]; then
        xinput --disable <device>
    fi
    sleep 0.1
done
esantix
  • 422
  • 3
  • 15
1

In Debian 10 gnome-screensaver-command -a can be used to enable blank screen (I set this up as a shortcut to Win-Shift-L). Mouse movement and modifier keys will turn the monitors back on but won't exit gnome-screensaver unless a normal key is pressed or a mouse button is clicked (or dragged?). Monitors turn back off after a very short delay while in gnome-screensaver.

Blank screen can also be done automatically after a delay the same way you would normally lock the screen automatically, just disable Automatic Screen Lock in Gnome Settings

Unfortunately the curtain appears to go away on mouse movements alone (and even other reasons?) in Gnome 3.38 (Debian 11 Bullseye); the net effect is that if anything unblanks the screen I get back to the desktop with normal blank timeout (set at 10 minutes for me, and this happens quite often even while I'm not at my computer at all) instead of blanking back after just a few seconds. I'm still looking for a way to re-enable it.