summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Makhov <streetturtle@users.noreply.github.com>2017-02-04 10:38:46 -0500
committerGitHub <noreply@github.com>2017-02-04 10:38:46 -0500
commit8671445a4fb574d713f3f083f2377497b3897d9c (patch)
treea7b36e87b9b135f1293ec88bd0925734210aa581
parent53e39d21d86477dd0ec1fbf747c941e928c8b8ff (diff)
Show 0 email if script returns nothing
-rw-r--r--email-widget/email.lua4
1 files changed, 2 insertions, 2 deletions
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/<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)
@@ -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)