From 74dc55add0c0122ffa6c159e8f290729ca60c5c0 Mon Sep 17 00:00:00 2001 From: Michael Mrozek Date: Fri, 30 Nov 2012 02:12:02 +0100 Subject: [PATCH] op_datetime.sh: Disable screensaver when syncing time over internet --- recipes/pandora-system/pandora-scripts/op_datetime.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/recipes/pandora-system/pandora-scripts/op_datetime.sh b/recipes/pandora-system/pandora-scripts/op_datetime.sh index 2d301af..3debe69 100644 --- a/recipes/pandora-system/pandora-scripts/op_datetime.sh +++ b/recipes/pandora-system/pandora-scripts/op_datetime.sh @@ -62,6 +62,11 @@ case $mainsel in fi ;; "sync") + screensaver_enabled=true + if xset q | grep -A2 'Screen Saver' | grep -q 'timeout:.*\<0\>.*cycle'; then + screensaver_enabled=false + fi + xset s off ( test -e /etc/init.d/ntpd && sudo /etc/init.d/ntpd stop sudo ntpdate pool.ntp.org @@ -71,6 +76,9 @@ case $mainsel in --text="Syncing with time server...\nPlease wait a while..." \ --pulsate test -e /etc/init.d/ntpd && sudo /etc/init.d/ntpd start + if $screensaver_enabled; then + xset s on + fi ;; esac done -- 2.47.2