From 8671445a4fb574d713f3f083f2377497b3897d9c Mon Sep 17 00:00:00 2001 From: Pavel Makhov Date: Sat, 4 Feb 2017 10:38:46 -0500 Subject: Show 0 email if script returns nothing --- email-widget/email.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'email-widget/email.lua') diff --git a/email-widget/email.lua b/email-widget/email.lua index 10027d1..d6619f9 100644 --- a/email-widget/email.lua +++ b/email-widget/email.lua @@ -14,7 +14,7 @@ email_icon:set_image(path_to_icons .. "/mail-mark-new.png") watch( "python /home//.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) @@ -39,4 +39,4 @@ function show_emails() ) end -email_icon:connect_signal("mouse::enter", function() show_emails() end) \ No newline at end of file +email_icon:connect_signal("mouse::enter", function() show_emails() end) -- cgit v1.2.3