4

On macOS Ventura I installed sleepwatcher using homebrew and activated the service using brew services start sleepwatcher. Strange enough it asked for permissions to watch all keystrokes. Ignoring this security issue for now, I granted the permission, but it appears the service is not working. As per the documentation I created bash scripts .sleep and .wakeup in my home directory, but nothing in these files gets executed. I checked and it looks like the relevant LaunchAgent is correctly placed in ~/Library/LaunchAgents/

Is anyone successfully running sleepwatcher on macOS Ventura?

2
  • I see that sleepwatcher is running, but it points to paths for the .sleep/.wakeup files: ps ax |grep sleepw yields /opt/homebrew/opt/sleepwatcher/sbin/sleepwatcher -V -s /Users/brew/actions-runner/_work/homebrew-core/homebrew-core/bottles/home/.sleep -w /Users/brew/actions-runner/_work/homebrew-core/homebrew-core/bottles/home/.wakeup. But even if I create those files/folders, sleep&watch doesn't seem to work.
    – neu242
    Commented Mar 22, 2023 at 10:46
  • 1
    I've added an issue for that here: github.com/Homebrew/homebrew-core/issues/126336
    – neu242
    Commented Mar 22, 2023 at 12:33

1 Answer 1

1

Seems to be working fine for me - I'm running Ventura 13.6.3 on Apple M2

My config:

$  sleepwatcher -v
sleepwatcher 2.2.1
Copyright (c) 2002-2019 Bernhard Baehr ([email protected])
This is free software that comes with ABSOLUTELY NO WARRANTY.
See the GNU General Public License for details.

$  ps ax |grep sleepw
 2314   ??  S      0:00.16 /opt/homebrew/opt/sleepwatcher/sbin/sleepwatcher -V -s /Users/admin/.sleep -w /Users/admin/.wakeup

I gave execution permissions to both files,

chmod a+x ~/.sleep
chmod a+x ~/.wakeup

checking the service with brew I get

$  brew services info sleepwatcher
sleepwatcher (homebrew.mxcl.sleepwatcher)
Running: ✔
Loaded: ✔
Schedulable: ✘
User: admin
PID: 2314

Lastly, my .sleep contains

#!/bin/bash

networksetup -setairportpower en0 off

Then, when I run

$  pmset sleepnow
Sleeping now...

and I re-login, I have my WiFi off

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .