fix no auto-lock on boot
This commit is contained in:
parent
fcaf355723
commit
cba3ba4b3b
16
src/xlock
16
src/xlock
|
@ -4,13 +4,17 @@ unlock_f="`mktemp --suffix=.xlock`";
|
||||||
log_b="0";
|
log_b="0";
|
||||||
|
|
||||||
|
|
||||||
# lock by default
|
|
||||||
rm "$unlock_f";
|
|
||||||
|
|
||||||
# automatic unlock if booted less than 2mins ago
|
|
||||||
onboot=`echo "$(cat /proc/uptime | awk '{print $1}') > 1000;" | bc`;
|
# returns whether the computer has just booted a few minutes ago
|
||||||
if [ "$onboot" -gt 0 ]; then
|
booted(){
|
||||||
touch "$unlock_f";
|
# onboot=`echo "$(cut -d' ' -f1 /proc/uptime) > 1000;" | bc`;
|
||||||
|
return echo "$(cut -d' ' -f1 /proc/uptime) > 1000;" | bc;
|
||||||
|
}
|
||||||
|
|
||||||
|
# lock by default (if not just booted)
|
||||||
|
if [ "$(booted)" -ne 1 ]; then
|
||||||
|
rm "$unlock_f";
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
|
|
Loading…
Reference in New Issue