1

I have an integrated colourimeter on the palm rest of my ThinkPad W520 running Debian 9 and it requires the lid to be closed during the calibration so it can "see" the screen.

I would like to know how to prevent my display to turn off when I close the lid of my laptop. Not only prevent it to sleep, but also keeping the screen on.

1

I haven't tried this, but you can read about inhibiting various dbus events here, including such things as shutdown and idle, but also specifically handle-lid-switch, assuming that is what your laptop is generating.

The systemd-inhibit command is a simple front-end to this mechanism, so you can try

systemd-inhibit --what=handle-lid-switch sleep 99

or similar to see if it blocks the event. Note that --mode=delay is only for sleep and shutdown, so you must use the default blocking mode, for which you may need to be root. Beware of not losing your dbus environment variables if you use sudo.

  • Thanks for your answer but it didn't work... I was kind of doing that without knowing. Gnome tweak-tool, which I use to prevent suspend when the lid is closed, actually do exactly what you did. I'm beginning to wonder if it is not a hardware switch or a really Thinkpad specific way to control that... Every info I found that should work do nothing... – Tonio Jun 18 '18 at 12:05
  • 1
    Perhaps the bios has options. You can also try sudo evtest to see if it lists a device with a lid switch event. If so you can try grabbing it evtest --grab /dev/input/event99 to stop anyone getting events from it. – meuh Jun 18 '18 at 12:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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