summaryrefslogtreecommitdiff
path: root/email-widget
diff options
context:
space:
mode:
Diffstat (limited to 'email-widget')
-rw-r--r--email-widget/email.lua18
1 files changed, 9 insertions, 9 deletions
diff --git a/email-widget/email.lua b/email-widget/email.lua
index d6619f9..f7656fb 100644
--- a/email-widget/email.lua
+++ b/email-widget/email.lua
@@ -5,30 +5,30 @@ local watch = require("awful.widget.watch")
local path_to_icons = "/usr/share/icons/Arc/actions/22/"
-email_widget = wibox.widget.textbox()
+local email_widget = wibox.widget.textbox()
email_widget:set_font('Play 9')
-email_icon = wibox.widget.imagebox()
+local email_icon = wibox.widget.imagebox()
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)
+ function(_, 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_icon:set_image(path_to_icons .. "/mail-mark-unread.png")
email_widget:set_text(stdout)
elseif (unread_emails_num == 0) then
- email_icon:set_image(path_to_icons .. "/mail-message-new.png")
- email_widget:set_text("")
- end
+ email_icon:set_image(path_to_icons .. "/mail-message-new.png")
+ email_widget:set_text("")
+ end
end
)
-function show_emails()
+local function show_emails()
awful.spawn.easy_async([[bash -c 'python /home/<username>/.config/awesome/email-widget/read_unread_emails.py']],
- function(stdout, stderr, reason, exit_code)
+ function(stdout)
naughty.notify{
text = stdout,
title = "Unread Emails",