distro specific fixes
[distro-setup] / btrfsmaint
index 85f2f349711dd92584430c059acffd4071d2aa46..3eb4759ad104029c54613c754a2980116ae95812 100755 (executable)
@@ -29,7 +29,7 @@ set -e; . /usr/local/lib/bash-bear; set +e
 # inspired from
 # https://github.com/kdave/btrfsmaintenance
 
-if [[ $INVOCATION_ID ]]; then
+if [[ $PPID == 1 ]]; then
   err-cleanup() {
     exim -odf -i root <<EOF
 From: root@$(hostname -f)
@@ -57,12 +57,10 @@ check-idle() {
   export XAUTHORITY=/home/iank/.Xauthority
   export DISPLAY=:0
   locked=false
-  if lock_info=$(xscreensaver-command -time); then
+  if lock_info=$(xscreensaver-command -time 2>/dev/null); then
     if [[ $lock_info != *non-blanked* ]]; then
       locked=true
     fi
-  else
-    locked=true
   fi
 }