Jump to content

Sleep system command doesn't work


ingenol

Recommended Posts

Steps to replicate:
 
1. Launch alfred
2. Select "Sleep"
3. Expected: machine sleeps
4. Actual: screen goes black as if to sleep but immediately "unsleeps". This happens consistently every time.
 
Alfred version: 4.6 [1266]
MacOS version: 12.0.1 (16" MBP Pro M1 Max)
 
It appears that others on Reddit are having this issue as well. Choosing sleep from the Apple menu works properly, just not when using Alfred.
Link to comment
Share on other sites

  • 1 month later...

@Andrew, the sleep command has stopped working for me.
I'm on version 4.6.1 [1274].
I'm not sure whether the issue started before or after upgrading to this version.

Selecting "Sleep" from the native Mac (apple) menu works OK.

I thought I'd try out the workflow shared here above, but the link is no longer active (https://transfer.sh/h8mSo7/Sleep.alfredworkflow).

Any idea what I can do?

edit: OS version is macOS Big Sur 11.6 (20G165)

Edited by burtyish
Link to comment
Share on other sites

@burtyish Welcome to the forum. You need to ensure you've granted Alfred Automation access to System Events for this.

 

Open your macOS Security & Privacy preferences > Privacy > Automation, and check that under Alfred 4 "System Events" is ticked.

 

If this box is already checked:

- Quit Alfred

- uncheck the box and re-check it in case macOS has lost resolution of the existing permissions

- Restart Alfred

 

Let me know how you get on :)

Link to comment
Share on other sites

  • 1 month later...

Hello! First time poster but a long-term Alfred user/fan here. I must say that I can't get the sleep command to work.  

 

Steps to replicate:
1. Launch alfred
2. Select "Sleep"
3. Expected: machine sleeps
4. Actual: Alfred's UI disappears but nothing else happens 
 
Alfred version: 4.6.3 [1285]
MacOS version: 12.2.1 (MacBook Air M1)
 
Troubleshooting steps attempted:
* disabling/enabling permissions (Accessibility and System Events)
* restarting the machine
* testing other system comments, e.g., Lock and Sleep displays work as expected
* creating a workflow with a sleep system command (no luck)
* checking system console for error entries and I consistently see 2 entries appearing
Launchd didn't have information for pid 2030, reason: Error Domain=NSPOSIXErrorDomain Code=113 "Unknown error: 113"

(the pid changes each time and when I try to find it in Activity Monitor, I can't find it) followed by

Error reading receipt: Error Domain=NSCocoaErrorDomain Code=256 "The file “receipt” couldn’t be opened." UserInfo={NSFilePath=/usr/bin/osascript/Contents/_MASReceipt/receipt, NSUnderlyingError=0x12e623420 {Error Domain=NSPOSIXErrorDomain Code=20 "Not a directory"}}

 

 

The last thing I want to add is that although I can't reproduce it, the first time I was troubleshooting permissions and checking the Activity Monitor I saw multiple instances of a process called sleep and for all those instances it was an Intel process running via Roseta2. Alfred is an Apple (arm) process.

 

 

Edited by remi_freamon
Link to comment
Share on other sites

16 minutes ago, vitor said:

What about this Workflow, does it work for you?

 

No, it doesn't.

 

However, I've just realized this may have nothing to do with Alfred. 

 

For some reason, the Sleep command is disabled by macOS. The option is greyed out in the  menu (see screenshot). Judging by this reddit thread, I'm not the only facing this problem.

 

CleanShot 2022-02-23 at 23.56.49.png

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...