iankelling.org
/
git
/
distro-setup
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
various fixes, a few new features
[distro-setup]
/
laptop-btrbk
diff --git
a/laptop-btrbk
b/laptop-btrbk
index b88d931debbc28fc313b1f7192c94d41dcbdba5a..c069f12745f581e1ae7289d18965ca059e22e6c6 100755
(executable)
--- a/
laptop-btrbk
+++ b/
laptop-btrbk
@@
-7,8
+7,15
@@
shopt -s inherit_errexit 2>/dev/null ||: # ignore fail in bash < 4.4
set -eE -o pipefail
trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?. PIPESTATUS: ${PIPESTATUS[*]}" >&2' ERR
set -eE -o pipefail
trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?. PIPESTATUS: ${PIPESTATUS[*]}" >&2' ERR
-idle_limit=$((1000 * 60 * 45))
-idle_time=$(sudo -u '#1000' xprintidle 2>/dev/null) ||:
-if [[ $idle_time && $idle_limit -lt $idle_time ]]; then
+locked=false
+if lock_info=$(xscreensaver-command -timer); then
+ if [[ $lock_info != *non-blanked* ]]; then
+ locked=true
+ fi
+else
+ locked=true
+fi
+
+if ! $locked; then
btrbk run
fi
btrbk run
fi