Fix error when no display number present in janek :0 2014-11-10 15:56

janek    pts/0        2014-11-10 15:57 (:0)
janek    pts/1        2014-11-10 15:57 (:0) output, closes #8
This commit is contained in:
Janek Bevendorff 2014-11-10 19:07:40 +01:00
parent 181b05d116
commit 75d2c11ace
1 changed files with 1 additions and 1 deletions

View File

@ -185,7 +185,7 @@ desktop_notify() {
fi
user=$(who | awk '/:0/ { print $1; exit; }')
if [ $(id -u) -ne 0 ] && [ $(id -u "$user") -ne $(id -u) ]; then
if [ $(id -u) -ne 0 ] && [[ "$user" != "" ]] && [ $(id -u "$user") -ne $(id -u) ]; then
# we're neither root nor the current user on display :0.0,
# so don't show any notification
return