From 00e4ef6b7be7f62521caca09defe44cd72e3cab2 Mon Sep 17 00:00:00 2001 From: rixx Date: Sun, 15 Mar 2015 00:54:24 +0100 Subject: imap only shows name if there are unread emails --- py3status/modules/imap.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'py3status/modules/imap.py') diff --git a/py3status/modules/imap.py b/py3status/modules/imap.py index d7ce5be..017bb3b 100644 --- a/py3status/modules/imap.py +++ b/py3status/modules/imap.py @@ -26,17 +26,21 @@ class Py3status: mail_count = self._get_mail_count() response = { - 'cached_until': time() + self.cache_timeout, - 'full_text': '{}: {}'.format(self.name, mail_count) + 'cached_until': time() + self.cache_timeout } - new_mail_color = i3s_config['color_good'] - check_failed_color = i3s_config['color_bad'] + new_mail_color = i3s_config['color_bad'] + response['full_text'] = 'blaa' if mail_count == 'N/A': - response['color'] = check_failed_color + response['color'] = '' + response['full_text'] = mail_count elif mail_count != 0: response['color'] = new_mail_color + response['full_text'] = self.name + else: + response['color'] = new_mail_color + response['full_text'] = '' return response -- cgit v1.3