This feels over engineeredĀ but…
I have always wanted to be able to put my Mac Pro to sleep using the power button on the Dell display I have connected to it. If you put the Mac to sleep and then turn off the display it will wake the mac up again due to the USB disconnect of the USB hub in the display.
I came across sleepwatcher which allows you to do stuff like this
Create a config file containing something likeĀ
timeout=100
idle=if [ `system_profiler SPUSBDataType | grep "Apple Keyboard" > /dev/null; \
echo $?` -eq 1 ]; then /usr/local/sbin/sleepwatcher -n;fi
(I have my Apple Keyboard connected to the USB hub in the display.) Then edit the sleepwatcher Launch script to use that config file - make the launch command look like this
/usr/local/sbin/sleepwatcher -d -V -s /etc/rc.sleep -w /etc/rc.wakeup -f /config/file
Restart sleepwatcher and press the power button on your display and wait 10 seconds…
Now must just remember that this will occur whenever I disconnect the keyboard.
0 Responses to “zzzZZZ”
Leave a Reply