# 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)
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
}