1
0
Fork 0

Make panel portable

This commit is contained in:
Jeremy Kaplan 2016-08-14 13:11:37 -04:00
commit 28d0527b54

View file

@ -87,7 +87,7 @@ def wifi_update(_):
if active: if active:
interface, network = active[0].split('-', 1) interface, network = active[0].split('-', 1)
else: else:
interface, network = 'wlp2s0', '-' interface, network = 'none', '-'
return 'wifi', color_string('{}: {}'.format(interface, network)) return 'wifi', color_string('{}: {}'.format(interface, network))
@ -111,7 +111,10 @@ def mail_update(_):
'mit': '#000099', 'mit': '#000099',
} }
for account, color in sorted(account_colors.items()): for account, color in sorted(account_colors.items()):
mail_path = os.path.expanduser('~/.mail/{}/Inbox/new'.format(account)) try:
mail_path = os.path.expanduser('~/.mail/{}/Inbox/new'.format(account))
except FileNotFoundError:
continue
message_count = len(os.listdir(mail_path)) message_count = len(os.listdir(mail_path))
colors = {} colors = {}
if message_count: if message_count: