Skip to content

Commit

Permalink
HACK: specialcase no essid available
Browse files Browse the repository at this point in the history
  • Loading branch information
ghedamat committed May 2, 2014
1 parent fe0e90b commit 62a351f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion i3status/wlan.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ func (w *WlanWidget) getStatus() (string, string) {
info.color = RED
} else {
re = regexp.MustCompile("\\[.*\\]")
info.NetworkName = re.FindAllString(lines[5], -1)[0]
matches := re.FindAllString(lines[5], -1)
if len(matches) > 0 {
info.NetworkName = matches[0]
}
}

return fmt.Sprintf("WLAN: %s %s", info.NetworkStatus, info.NetworkName), info.color
Expand Down

0 comments on commit 62a351f

Please sign in to comment.