- Joined
- Oct 16, 2020
- Messages
- 115
- Motherboard
- Thinkpad T440P
- CPU
- i7-4710MQ
- Graphics
- HD 4600
- Mac
- Mobile Phone
here is what im doing
Connor@Connors-MBP-2 ~ % sudo mkdir -p /usr/local/sbin /usr/local/share/man/man8
Connor@Connors-MBP-2 ~ % sudo cp ~/Desktop/sleepwatcher_2.2.1/sleepwatcher /usr/local/sbin
Connor@Connors-MBP-2 ~ % sudo cp ~/Desktop/sleepwatcher_2.2.1/sleepwatcher.8 /usr/local/share/man/man8
Connor@Connors-MBP-2 ~ % sudo cp ~/Desktop/sleepwatcher_2.2.1/config/de.bernhard-baehr.sleepwatcher-20compatibility.plist /Library/LaunchDaemons/de.bernhard-baehr.sleepwatcher.plist
Connor@Connors-MBP-2 ~ % sudo launchctl load -w -F /Library/LaunchDaemons/de.bernhard-baehr.sleepwatcher.plist
/Library/LaunchDaemons/de.bernhard-baehr.sleepwatcher.plist: service already loaded
Load failed: 37: Operation already in progress
Connor@Connors-MBP-2 ~ %
Next, instructions from @Creo2005 say this
"You can then add your scripts to /etc/rc.wakeup and /etc/rc.sleep:"
so i take the rc.wakeup and rc.sleep file from /desktop/sleepwatcher_2.2.1/config/
and manually drag them into /etc/
then i run these commands as @Creo2005 instructions say
Connor@Connors-MBP-2 ~ % sudo touch /etc/rc.wakeup
Connor@Connors-MBP-2 ~ % sudo touch /etc/rc.sleep
Connor@Connors-MBP-2 ~ % sudo chmod +x /etc/rc.sleep /etc/rc.wakeup
the instructions then say to edit rc.wakeup and add script, so i open the rc.wakeup file in /etc/ and edit it, but it tells me i can not edit it, so i remove it from the folder to desktop, edit, save, replace the old file in /etc/ and run these commands again
Connor@Connors-MBP-2 ~ % sudo touch /etc/rc.wakeup
Connor@Connors-MBP-2 ~ % sudo touch /etc/rc.sleep
Connor@Connors-MBP-2 ~ % sudo chmod +x /etc/rc.sleep /etc/rc.wakeup
if i open my rc.wakeup this is what it reads
#!/bin/sh
for user in `echo 'show State:/Users/ConsoleUser' | scutil | awk '/kCGSSessionUserNameKey/ { print $3 }'`; do
home=`eval echo ~$user`
if [ -x "$home/.wakeup" ]; then
logger -t $0 "executing .wakeup of user $user"
su - $user -c "\"$home/.wakeup\""
fi
done
sleep 5
pkill bluetoothd
here is all my sleepwatcher logs since trying to get this working
Connor@Connors-MBP-2 ~ % log show -last 1000|grep sleepwatcher
2021-12-19 21:36:44.374130+0000 0x93d Activity 0xf2c 398 0 sleepwatcher: (TCC) TCCAccessRequest() IPC
2021-12-19 21:36:44.374291+0000 0x93d Error 0x0 398 0 sleepwatcher: (IOHIDLib) [com.apple.iohid:default] 0x100000c06: TCC deny IOHIDDeviceOpen
2021-12-19 21:36:44.374369+0000 0x93d Error 0x0 398 0 sleepwatcher: (IOHIDLib) [com.apple.iohid:default] 0x100000c06: TCC deny IOHIDDeviceOpen
2021-12-19 21:36:53.715725+0000 0x93d Activity 0xf2d 398 0 sleepwatcher: (TCC) TCCAccessRequest() IPC
2021-12-19 21:36:53.715807+0000 0x93d Error 0x0 398 0 sleepwatcher: (IOHIDLib) [com.apple.iohid:default] 0x100000c14: TCC deny IOHIDDeviceOpen
2021-12-19 21:36:53.715833+0000 0x93d Error 0x0 398 0 sleepwatcher: (IOHIDLib) [com.apple.iohid:default] 0x100000c14: TCC deny IOHIDDeviceOpen
2021-12-19 21:37:12.382909+0000 0x93d Activity 0xf2e 398 0 sleepwatcher: (TCC) TCCAccessRequest() IPC
2021-12-19 21:37:12.383004+0000 0x93d Error 0x0 398 0 sleepwatcher: (IOHIDLib) [com.apple.iohid:default] 0x100000c27: TCC deny IOHIDDeviceOpen
2021-12-19 21:37:12.383032+0000 0x93d Error 0x0 398 0 sleepwatcher: (IOHIDLib) [com.apple.iohid:default] 0x100000c27: TCC deny IOHIDDeviceOpen
2021-12-19 21:41:09.766979+0000 0xad9c Default 0x0 1427 0 sudo: Connor : TTY=ttys000 ; PWD=/Users/Connor ; USER=root ; COMMAND=/bin/cp sleepwatcher /usr/local/sbin
2021-12-19 21:42:32.926847+0000 0xb0e8 Default 0x0 1457 0 sudo: Connor : TTY=ttys000 ; PWD=/Users/Connor ; USER=root ; COMMAND=/bin/cp /Users/Connor/Desktop/sleepwatcher_2.2.1/sleepwatcher /usr/local/sbin
2021-12-19 21:42:43.434471+0000 0xb130 Default 0x0 1460 0 sudo: Connor : TTY=ttys000 ; PWD=/Users/Connor ; USER=root ; COMMAND=/bin/cp /Users/Connor/Desktop/sleepwatcher_2.2.1/sleepwatcher.8 /usr/local/share/man/man8
2021-12-19 21:43:05.462455+0000 0xb1d8 Default 0x0 1463 0 sudo: Connor : TTY=ttys000 ; PWD=/Users/Connor ; USER=root ; COMMAND=/bin/cp /Users/Connor/Desktop/sleepwatcher_2.2.1/config/de.bernhard-baehr.sleepwatcher-20compatibility.plist /Library/LaunchDaemons/de.bernhard-baehr.sleepwatcher.plist
2021-12-19 21:43:20.626864+0000 0xb286 Default 0x0 1466 0 sudo: Connor : TTY=ttys000 ; PWD=/Users/Connor ; USER=root ; COMMAND=/bin/launchctl load -w -F /Library/LaunchDaemons/de.bernhard-baehr.sleepwatcher.plist
2021-12-19 21:43:20.630257+0000 0xb08b Default 0x0 1 0 launchd: [system:] Enabling service de.bernhard-baehr.sleepwatcher
2021-12-19 21:43:20.630284+0000 0xb08b Default 0x0 1 0 launchd: [system:] Bootstrap by launchctl[1467] for /Library/LaunchDaemons/de.bernhard-baehr.sleepwatcher.plist failed (37: Operation already in progress)
Connor@Connors-MBP-2 ~ % sudo mkdir -p /usr/local/sbin /usr/local/share/man/man8
Connor@Connors-MBP-2 ~ % sudo cp ~/Desktop/sleepwatcher_2.2.1/sleepwatcher /usr/local/sbin
Connor@Connors-MBP-2 ~ % sudo cp ~/Desktop/sleepwatcher_2.2.1/sleepwatcher.8 /usr/local/share/man/man8
Connor@Connors-MBP-2 ~ % sudo cp ~/Desktop/sleepwatcher_2.2.1/config/de.bernhard-baehr.sleepwatcher-20compatibility.plist /Library/LaunchDaemons/de.bernhard-baehr.sleepwatcher.plist
Connor@Connors-MBP-2 ~ % sudo launchctl load -w -F /Library/LaunchDaemons/de.bernhard-baehr.sleepwatcher.plist
/Library/LaunchDaemons/de.bernhard-baehr.sleepwatcher.plist: service already loaded
Load failed: 37: Operation already in progress
Connor@Connors-MBP-2 ~ %
Next, instructions from @Creo2005 say this
"You can then add your scripts to /etc/rc.wakeup and /etc/rc.sleep:"
so i take the rc.wakeup and rc.sleep file from /desktop/sleepwatcher_2.2.1/config/
and manually drag them into /etc/
then i run these commands as @Creo2005 instructions say
Connor@Connors-MBP-2 ~ % sudo touch /etc/rc.wakeup
Connor@Connors-MBP-2 ~ % sudo touch /etc/rc.sleep
Connor@Connors-MBP-2 ~ % sudo chmod +x /etc/rc.sleep /etc/rc.wakeup
the instructions then say to edit rc.wakeup and add script, so i open the rc.wakeup file in /etc/ and edit it, but it tells me i can not edit it, so i remove it from the folder to desktop, edit, save, replace the old file in /etc/ and run these commands again
Connor@Connors-MBP-2 ~ % sudo touch /etc/rc.wakeup
Connor@Connors-MBP-2 ~ % sudo touch /etc/rc.sleep
Connor@Connors-MBP-2 ~ % sudo chmod +x /etc/rc.sleep /etc/rc.wakeup
if i open my rc.wakeup this is what it reads
#!/bin/sh
for user in `echo 'show State:/Users/ConsoleUser' | scutil | awk '/kCGSSessionUserNameKey/ { print $3 }'`; do
home=`eval echo ~$user`
if [ -x "$home/.wakeup" ]; then
logger -t $0 "executing .wakeup of user $user"
su - $user -c "\"$home/.wakeup\""
fi
done
sleep 5
pkill bluetoothd
here is all my sleepwatcher logs since trying to get this working
Connor@Connors-MBP-2 ~ % log show -last 1000|grep sleepwatcher
2021-12-19 21:36:44.374130+0000 0x93d Activity 0xf2c 398 0 sleepwatcher: (TCC) TCCAccessRequest() IPC
2021-12-19 21:36:44.374291+0000 0x93d Error 0x0 398 0 sleepwatcher: (IOHIDLib) [com.apple.iohid:default] 0x100000c06: TCC deny IOHIDDeviceOpen
2021-12-19 21:36:44.374369+0000 0x93d Error 0x0 398 0 sleepwatcher: (IOHIDLib) [com.apple.iohid:default] 0x100000c06: TCC deny IOHIDDeviceOpen
2021-12-19 21:36:53.715725+0000 0x93d Activity 0xf2d 398 0 sleepwatcher: (TCC) TCCAccessRequest() IPC
2021-12-19 21:36:53.715807+0000 0x93d Error 0x0 398 0 sleepwatcher: (IOHIDLib) [com.apple.iohid:default] 0x100000c14: TCC deny IOHIDDeviceOpen
2021-12-19 21:36:53.715833+0000 0x93d Error 0x0 398 0 sleepwatcher: (IOHIDLib) [com.apple.iohid:default] 0x100000c14: TCC deny IOHIDDeviceOpen
2021-12-19 21:37:12.382909+0000 0x93d Activity 0xf2e 398 0 sleepwatcher: (TCC) TCCAccessRequest() IPC
2021-12-19 21:37:12.383004+0000 0x93d Error 0x0 398 0 sleepwatcher: (IOHIDLib) [com.apple.iohid:default] 0x100000c27: TCC deny IOHIDDeviceOpen
2021-12-19 21:37:12.383032+0000 0x93d Error 0x0 398 0 sleepwatcher: (IOHIDLib) [com.apple.iohid:default] 0x100000c27: TCC deny IOHIDDeviceOpen
2021-12-19 21:41:09.766979+0000 0xad9c Default 0x0 1427 0 sudo: Connor : TTY=ttys000 ; PWD=/Users/Connor ; USER=root ; COMMAND=/bin/cp sleepwatcher /usr/local/sbin
2021-12-19 21:42:32.926847+0000 0xb0e8 Default 0x0 1457 0 sudo: Connor : TTY=ttys000 ; PWD=/Users/Connor ; USER=root ; COMMAND=/bin/cp /Users/Connor/Desktop/sleepwatcher_2.2.1/sleepwatcher /usr/local/sbin
2021-12-19 21:42:43.434471+0000 0xb130 Default 0x0 1460 0 sudo: Connor : TTY=ttys000 ; PWD=/Users/Connor ; USER=root ; COMMAND=/bin/cp /Users/Connor/Desktop/sleepwatcher_2.2.1/sleepwatcher.8 /usr/local/share/man/man8
2021-12-19 21:43:05.462455+0000 0xb1d8 Default 0x0 1463 0 sudo: Connor : TTY=ttys000 ; PWD=/Users/Connor ; USER=root ; COMMAND=/bin/cp /Users/Connor/Desktop/sleepwatcher_2.2.1/config/de.bernhard-baehr.sleepwatcher-20compatibility.plist /Library/LaunchDaemons/de.bernhard-baehr.sleepwatcher.plist
2021-12-19 21:43:20.626864+0000 0xb286 Default 0x0 1466 0 sudo: Connor : TTY=ttys000 ; PWD=/Users/Connor ; USER=root ; COMMAND=/bin/launchctl load -w -F /Library/LaunchDaemons/de.bernhard-baehr.sleepwatcher.plist
2021-12-19 21:43:20.630257+0000 0xb08b Default 0x0 1 0 launchd: [system:] Enabling service de.bernhard-baehr.sleepwatcher
2021-12-19 21:43:20.630284+0000 0xb08b Default 0x0 1 0 launchd: [system:] Bootstrap by launchctl[1467] for /Library/LaunchDaemons/de.bernhard-baehr.sleepwatcher.plist failed (37: Operation already in progress)