1
0
Fork 0

Update panel_bar for new netctl-auto version

This commit is contained in:
Jeremy Kaplan 2016-07-08 10:15:38 -04:00
commit 14140c6dc7

View file

@ -77,10 +77,11 @@ def volume_update(_):
return 'volume', color_string("Vol: %d%s" % (volume, mute_icon), **kwargs) return 'volume', color_string("Vol: %d%s" % (volume, mute_icon), **kwargs)
def wifi_update(_): def wifi_update(_):
info = subprocess.check_output(['netctl-auto', 'current']) info = subprocess.check_output(['netctl-auto', 'list'])
info = info[:-1].decode('utf-8') active = [line for line in info.splitlines() if line[0] == '*']
if info:
interface, network = info.split('-', 1) if active:
interface, network = active[0].split('-', 1)
else: else:
interface, network = 'wlp2s0', '-' interface, network = 'wlp2s0', '-'
return 'wifi', color_string('{}: {}'.format(interface, network)) return 'wifi', color_string('{}: {}'.format(interface, network))