a55e738c145b44f13d1d6be38c768a655428e54c — Charles Daniels 3 months ago 7fac1bd
fix locknow
1 files changed, 6 insertions(+), 2 deletions(-)

M overlay/bin/locknow
M overlay/bin/locknow => overlay/bin/locknow +6 -2
@@ 1,4 1,4 @@
-#!/bin/sh
+#!/usr/bin/env bash
 
 # lock the screen now
 


@@ 10,7 10,11 @@ else
 	if xautolock -locknow 2>&1 | grep -q "Could not locate a running xautolock" ; then
 		echo "restarting xautolock... "
 		sleep 1
-		kill "$(ps aux | awk '$11 ~ /^xautolock/ {print($2)}')"
+		if [ "$(ps aux | awk '$11 ~ /^xautolock/ {print($2)}' | wc -l)" -gt 0 ] ; then
+			kill "$(ps aux | awk '$11 ~ /^xautolock/ {print($2)}')"
+		fi
+		xautolock -time $config -locker "xset dpms force off && xtrlock -b" &
+		disown
 		$0
 	fi
 fi