On 12/05/2022 14:31, Greg Wooledge wrote:
On Thu, May 12, 2022 at 02:06:24PM +0100, Ottavio Caruso wrote:#!/bin/sh systemctl suspend && mate-screensaver-command -l This one seems to work, however I would have thought that the logical sequence would be: mate-screensaver-command -l && systemctl suspend that is, a) lock screen; b) suspend; c) resume with lock screen on. Instead, if I use the latter syntax, upon resuming, there is a 10 second delay before locking the screen, which is not ideal for obvious privacy reasons. Any input on that?Any analysis here would require some knowledge of what each of these commands actually*does*. I know nothing about mate-screensaver-command, so I can only focus on systemctl.
man systemctl suspendSuspend the system. This will trigger activation of the special target unit suspend.target. This command is asynchronous, and will return after the suspend operation is successfully enqueued. It
will not wait for the suspend/resume cycle to complete. man mate-screensaver-command -l, --lockTells the running screensaver process to lock the screen immediately.
"race condition" or not, it doesn't make sense that, upon resume, the screen lock pauses for 10 seconds and then reactivates.
-- Ottavio Caruso A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail?