Jump to content

Since upgrading to High-Sierra "lock" takes 5-10 seconds to lock the screen [Fixed 3.6 b893 pre-release]


sid

Recommended Posts

Hi @sid and welcome to the forum!

 

We recommend setting "Require password after sleep" and using the "sleepdisplays" keyword instead, which is much more reliable. 

 

You can even disable the "lock" action and rename "sleepdisplays" to it instead, if it helps with your habits :)

 

Cheers,
Vero

Link to comment
Share on other sites

1 hour ago, Vero said:

We recommend setting "Require password after sleep" and using the "sleepdisplays" keyword instead, which is much more reliable. 

 

Unfortunately that has a fundamental difference, and I predict many people won’t like the alternative (me included). I never forget to Lock when I go away and never want my screen to lock when I’m close and it turns off (more often than not it’s because I stopped to talk and am still in front of my machine; I don’t want to reenter my password).

 

It was suggested in another thread that even the macOS CLI command for locking ("/System/Library/CoreServices/Menu Extras/User.menu/Contents/Resources/CGSession" -suspend) may be slow. Can you confirm that, @sid? If it is still slow, then this is a macOS issue (not an Alfred one) and you should instead open a bug report with Apple.

Edited by vitor
Link to comment
Share on other sites

I'm going to make do with the sleepdisplays until I hear back from Apple.  

 

One gotcha with this solution is some displays  ( mine included ) don't reliably wake after being put to sleep and a reboot is necessary. :unsure: 

Edited by sid
spelling
Link to comment
Share on other sites

I think I'd rather stick to Lock than to use something that could screw any displays up, it's worth noting that the Lock function does work, it locks the screen right away it just takes 10-15 seconds to update the screen toothed locked state.

I wouldn't rely on Apple getting back to you any time soon!

Link to comment
Share on other sites

  • 2 weeks later...

Is there no way of triggering the native "Lock Screen" function? This is now in the Mac Menu in High Sierra, and available with the (awkward) shortcut of Ctrl-Cmd-Q. It's also available to map to the Control Strip on the Touch Bar, and definitely the quickest of the three options.

 

I think Sleep Displays works best for me at the moment, I can confirm that the issue with the existing "lock" command in Alfred is that now "/System/Library/CoreServices/Menu Extras/User.menu/Contents/Resources/CGSession" -suspend takes a long time.

Link to comment
Share on other sites

Here is a super simple workflow which uses keyword ('simlock' by default) and simulates ctrl-cmd-q.

 

---- LINK REMOVED ---

Note: this is now fixed in 3.6 b893 pre-release, so workflow is no longer needed

 

Note @Tetsugaku you'll need the Powerpack for this - if you already have this, could you please fill in your registered PP address in the forum profile, this is only visible to admins.

 

Cheers,

Andrew

Link to comment
Share on other sites

Hello and thanks for that (PP email updated). I disabled the system command lock in Alfred, renamed the WF to Lock and it seems to be working great at this stage - thanks for the input. Not sure if its worth updating core Alfred to work in  a similar way. thanks again

Link to comment
Share on other sites

  • 2 months later...

Great workflow. Thanks for that. If anybody could update on the status of fixing the "lock" native command, that would be great. Call me OCD, but I'd prefer to use that as opposed to a workflow. Great stuff either way, thanks guys, for all the hard work! 

Link to comment
Share on other sites

@jerman885 @altryne In case you hadn't noticed, the solution provided as a workflow here is by @Andrew (the creator of Alfred).

 

As such, if the "lock" command is fixed in Alfred itself - which is likely to be the case - it would be identical to the workflow (but built into Alfred behind the scenes), so the most expedient way to resolve this for now is to replace the default "lock" keyword with Andrew's workflow :)

 

Cheers,
Vero

Link to comment
Share on other sites

  • Andrew changed the title to Since upgrading to High-Sierra "lock" takes 5-10 seconds to lock the screen [Fixed 3.6 b893 pre-release]
  • 2 weeks later...
23 minutes ago, Olaf said:

It would be great if you could still supply the link to the workaround script here for people still using Alfred 2 (like myself).

 

I think the workaround Workflow used an Alfred 3-only feature (simulating keypresses), so it wouldn’t be useful for people on Alfred 2.


The following should work for you (untested, as I’m not yet on High Sierra). Connect a Keyword to a Run Script with Language /usr/bin/osascript (AS) and code:

tell application "System Events" to keystroke "w" using {control down, command down}

Link to comment
Share on other sites

Thanks vitor,

 

I am now using a "Run NSAppleScript" workflow command with the following content and it works fine:

 

on alfred_script(q)
  tell application "System Events"
    keystroke "q" using {control down, command down}
  end tell
end alfred_script

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...