Home | News | Download | Packages | Forum | Wiki | Github

Locking screen on lid-close

(rakor) #1

Hi there, I run cinnamon on my x220. In the settings of the screensaver I activated that the screen should be locked when I close the lid. Poorly this doesn’t seem to work. Might be the scrennsaver does not recognise that the lid is beeing closed.

I worked it around by putting this script in the autostart of cinnamon:

acpi_listen | while IFS= read -r line;
if [ “$line” == “button/lid LID close” ]
cinnamon-screensaver-command -l
elif [ “$line” == “button/lid LID close” ]
notify-send “Welcome back”

It is working but not the best way, as screensaver gives this option. Do you know this problem? is there a better way? Can it be easily fixed?


Did you check /etc/acpi/handler.sh , to see if you can use it?
(part of acpid package)

(rakor) #3

No I’ve not. Thanks for the hint. I’ll test it this evening. But I fear, that it could be a problem, cause it should know the session it has to lock. And a systemscript won’t know I think. But I’ll look at it.

(rakor) #4

OK the cinnamon-screensaver-command can not connect to the process, as I thought. Maybe I could investigate but it would be fiddeling… Note better than my workaround at the moment I think.

One should find a way that the screensaver recognizes that the lid was closed. Then it would operate as suggested (even with other screensavers I think).
So why does the screensaver not know that the lid was closed. Where does it listen, and how can we bring the trigger there?