From 28d0527b5448c3c844e4020e83560d61e3089c66 Mon Sep 17 00:00:00 2001 From: Jeremy Kaplan Date: Sun, 14 Aug 2016 13:11:37 -0400 Subject: [PATCH] Make panel portable --- panel/panel_bar.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/panel/panel_bar.py b/panel/panel_bar.py index d4b7b4c..8134be5 100755 --- a/panel/panel_bar.py +++ b/panel/panel_bar.py @@ -87,7 +87,7 @@ def wifi_update(_): if active: interface, network = active[0].split('-', 1) else: - interface, network = 'wlp2s0', '-' + interface, network = 'none', '-' return 'wifi', color_string('{}: {}'.format(interface, network)) @@ -111,7 +111,10 @@ def mail_update(_): 'mit': '#000099', } 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)) colors = {} if message_count: