Show 0 email if script returns nothing
This commit is contained in:
parent
53e39d21d8
commit
8671445a4f
|
@ -14,7 +14,7 @@ email_icon:set_image(path_to_icons .. "/mail-mark-new.png")
|
|||
watch(
|
||||
"python /home/<username>/.config/awesome/email-widget/count_unread_emails.py", 20,
|
||||
function(widget, stdout, stderr, exitreason, exitcode)
|
||||
local unread_emails_num = tonumber(stdout)
|
||||
local unread_emails_num = tonumber(stdout) or 0
|
||||
if (unread_emails_num > 0) then
|
||||
email_icon:set_image(path_to_icons .. "/mail-mark-unread.png")
|
||||
email_widget:set_text(stdout)
|
||||
|
|
Loading…
Reference in New Issue