From bfb8a50c4a08d7dafd3646b502a8032f13ce63c0 Mon Sep 17 00:00:00 2001 From: Sanchayan Maity Date: Mon, 6 Jan 2020 12:35:17 +0530 Subject: [PATCH] mutt: Fix mailnotify script Signed-off-by: Sanchayan Maity --- mutt/.mutt/mailnotify.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mutt/.mutt/mailnotify.sh b/mutt/.mutt/mailnotify.sh index 0299d83..dafd683 100755 --- a/mutt/.mutt/mailnotify.sh +++ b/mutt/.mutt/mailnotify.sh @@ -8,8 +8,10 @@ export DISPLAY=:0 let inbox=`ls /home/core/Gmail/sanchayan/Inbox/new/|wc -l` let nilenso_inbox=`ls /home/core/Gmail/nilenso/Inbox/new/|wc -l` -if (("$inbox" > 0) || ("$nilenso_inbox" > 0)); then +if [ "$inbox" -gt 0 ]; then sudo -u core DISPLAY=:0 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus notify-send "You have $inbox new mails in inbox" - sudo -u core DISPLAY=:0 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus notify-send "You have $nilenso_inbox new mails in Nilenso inbox" fi +if [ "$nilenso_inbox" -gt 0 ]; then + sudo -u core DISPLAY=:0 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus notify-send "You have $nilenso_inbox new mails in Nilenso inbox" +fi