mirror of
git://code.qt.io/qt/qt5.git
synced 2026-04-20 20:06:32 +08:00
Provisioning: MacOS-10.12 - Disable sleep
Display sleep and system sleep need to be disabled to prevent the machine from going to sleep during RTA testing. Task-number: QTQAINFRA-1588 Change-Id: I3dc1642d3714762bfb56963392d2bb5137c13256 Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
This commit is contained in:
@@ -49,6 +49,7 @@ ExceptionSetDelay=102
|
|||||||
ExceptionVNC=103
|
ExceptionVNC=103
|
||||||
ExceptionNTS=104
|
ExceptionNTS=104
|
||||||
ExceptionDisableScreensaverPassword=105
|
ExceptionDisableScreensaverPassword=105
|
||||||
|
ExceptionDisableSleep=106
|
||||||
|
|
||||||
try
|
try
|
||||||
(
|
(
|
||||||
@@ -56,6 +57,9 @@ try
|
|||||||
# For current session
|
# For current session
|
||||||
defaults -currentHost write com.apple.screensaver idleTime 0 || throw $ExceptionDisableScreensaver
|
defaults -currentHost write com.apple.screensaver idleTime 0 || throw $ExceptionDisableScreensaver
|
||||||
|
|
||||||
|
echo "Disable sleep"
|
||||||
|
sudo pmset sleep 0 displaysleep 0 || throw $ExceptionDisableSleep
|
||||||
|
|
||||||
# For session after a reboot
|
# For session after a reboot
|
||||||
mkdir -p "$HOME/Library/LaunchAgents" || throw $ExceptionDisableScreensaver
|
mkdir -p "$HOME/Library/LaunchAgents" || throw $ExceptionDisableScreensaver
|
||||||
(
|
(
|
||||||
@@ -126,5 +130,10 @@ catch || {
|
|||||||
echo "Failed to disable requiring of password after screensaver is enabled."
|
echo "Failed to disable requiring of password after screensaver is enabled."
|
||||||
exit 1;
|
exit 1;
|
||||||
;;
|
;;
|
||||||
|
$ExceptionDisableSleep)
|
||||||
|
echo "Failed to disable sleep."
|
||||||
|
exit 1;
|
||||||
|
;;
|
||||||
|
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user