[X2Go-Commits] [live-build-x2go] 102/108: moved detection regarding which sleep command is to be used into the backgrounded task, added comments

git-admin at x2go.org git-admin at x2go.org
Wed Mar 20 22:13:27 CET 2019


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch feature/openbox
in repository live-build-x2go.

commit 159769631956b5000f91805781d608d4830a8860
Author: Stefan Baur (BAUR-ITCS) <kontakt at baur-itcs.de>
Date:   Wed Feb 6 12:30:11 2019 +0000

    moved detection regarding which sleep command is to be used into the backgrounded task, added comments
---
 .../lib/live/config/0000-earlyblankdpmsfix         | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/config/includes.chroot/lib/live/config/0000-earlyblankdpmsfix b/config/includes.chroot/lib/live/config/0000-earlyblankdpmsfix
index 32be175..9ed721f 100755
--- a/config/includes.chroot/lib/live/config/0000-earlyblankdpmsfix
+++ b/config/includes.chroot/lib/live/config/0000-earlyblankdpmsfix
@@ -10,17 +10,23 @@ echo -n " earlyblankdpmsfix"
 # code to fix blank screen happening with DisplayPort and some buggy TFTs (even xset q reports "Monitor is on" even though it is pitch black)
 if grep -q '\W*earlyblankdpmsfix[=\W]*' /proc/cmdline; then
 	SLEEPTIME=$(cat /proc/cmdline | tr ' ' '\n' | awk -F'=' '"earlyblankdpmsfix"==$1 {print $2}' | tr -dc '0-9')
-	[ -z "$SLEEPTIME" ] && SLEEPTIME=1000
-	if [ -x /bin/usleep ] ; then
-		SLEEPCOMMAND="/bin/usleep $((SLEEPTIME*1000))" # usleep uses microseconds, not milliseconds
-	else
-		SLEEPTIME=$(echo $SLEEPTIME | awk '{ printf "%s", $1/1000 }') # awk works for fractions so we don't need bc
-		SLEEPCOMMAND="/bin/sleep $SLEEPTIME"
-	fi
+
+	# SLEEPTIME is a value set in milliseconds -- not microseconds and not seconds either
+
+	[ -z "$SLEEPTIME" ] && SLEEPTIME=1000 # so we default to 1000 milliseconds = 1 second
+
 	(
 		while ! ( [ -d /sys/class/graphics ] && [ -n "$(find /sys/class/graphics/ -maxdepth 1 -type l -name "fb[0-9]*")" ] && [ -c /dev/tty1 ] && [ -c /dev/vcs1 ] ) ; do
-			sleep 1
+			sleep 1 # here, it doesn't matter which sleep is used, as we are only using an integer number
 		done
+
+		if [ -x /bin/usleep ] ; then
+			SLEEPCOMMAND="/bin/usleep $((SLEEPTIME*1000))" # usleep uses microseconds, not milliseconds
+		else
+			SLEEPTIME=$(echo $SLEEPTIME | awk '{ printf "%s", $1/1000 }') # awk works for fractions so we don't need bc
+			SLEEPCOMMAND="/bin/sleep $SLEEPTIME"
+		fi
+
 		for FBDEVICE in /sys/class/graphics/fb[0-9]*; do
 			echo 1 > $FBDEVICE/blank
 			$SLEEPCOMMAND

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/live-build-x2go.git


More information about the x2go-commits mailing list