[Feature Request] - Add support for "Screen OFF on leave" feature aka "Screen Lock On Leave"

Few ThinkPad products support features related to “Human Presence Detection”.

This feature is “Screen OFF on Leave” aka Screen “Lock on leave” .
Earlier this feature was called as “Lock on Leave” but in future, this feature will be changed to “Screen OFF” only on Leave for user convenience. This will be same as Windows also.

Microsoft Reference Links:

We did some current prototype outside GNOME like below:

There are 2 sysfs for HPD detection used for this feature-

  • /sys/bus/iio/devices/iio:device0/in_proximity0_raw - For HPD detected /undetected
  • /sys/bus/iio/devices/iio:device0/in_proximity1_raw - For HPD Proximity i.e distance

Current Issue:

Screen blank has fading animation during idle which we want to remove .

It will be helpful , if there is any comment and we can add this feature in GNOME settings .

Thank you !

Hello all.
This is in support to @nitin_exclusively’s request.
Basically, the proposal is as below:

Above modifications were made on gnome-46 and Ubuntu 24.04 as of now, but will eventually update to latest versions.
However, could not fully test gsettings-desktop-schema ScreenOffOnLeave modification because of issues during install. So during testing, I am currently testing on a branch without screen-off-on-leave implementation for both the gnome-shell extension and GUI app.

How this works:

  1. Set Screen-Off-On-Leave setting → True when Screen-Off-On-Leave Feature is enabled
  2. (Extension is enabled) Screen-Off-On-Leave Feature will utilize HPD Proximity and Distance values for determining if Screen Blank should be triggered. Screen-Blank Sequence is triggered (by setting idle-delay to 1 sec) when person is not detected after set amount of time and distance.
  3. Disable-lock-screen is set to True
  4. Screen-Off-On-Leave setting is checked if it is True in the extension. If True, disable-lock-screen setting is checked. If True, then during screen blank, fade animation is disabled.
  5. The normal idle-delay value is restored after this sequence.

The proposal might be rough around the edges, but I am very much open to any suggestions on how best to implement this feature.

I had made a post about disabling fade and lock screen in an earlier post
Screen blank without fade animation or lock screen - Desktop - GNOME Discourse
But I did find a way, using gnome-shell-extension as of now.

This looks very interesting.

Have you considered doing this through/with? https://gitlab.freedesktop.org/hadess/iio-sensor-proxy

@felipeborges Thanks for your comment ! No , we have not considered it as we can use sysfs directly . Also , since the functionality is GUI based and we can use it directly in GNOME . Is it recommended to check it ?
I have tried checking it today but it seems can’t see hpd sensor information … may need some support for iio_proxy_sensor maintainer, if we need to use it ,

Btw , as @Josef-Ouano has mentioned, do you have any comment regarding Screenshied and gsettings-desktop schema changes ?

Thank you !