breto

A status bar written in Go.
Log | Files | Refs | README | LICENSE

commit b33e27e3735ad602417c809a7ec15c520b5bdb84
parent b80ed5fc025f19ff8a3419f443cf206835bffc28
Author: Jaron Swab <jrswab@gmail.com>
Date:   Thu,  6 Jun 2019 17:46:21 -0400

Changed check for wttr server error webpage responce.

Counting the characters did not produce the desired outcome.
Instead the import now uses strings.Contians()

Diffstat:
Mblocks/wttr.go | 4++--
Mmain.go | 2+-
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/blocks/wttr.go b/blocks/wttr.go @@ -28,8 +28,8 @@ func Wttr(cWttr chan string, eWttr chan error) { } bodyData, _ := ioutil.ReadAll(resp.Body) - if len(bodyData) > 100 { // wttr.in displays a webpage on server error - data = "wttr.in overloaded" // display this on wttr.in server error + if strings.Contain(bodyData, "error") { // wttr.in displays a webpage on server error + data <- "wttr.in overloaded" // display this on wttr.in server error } // convert responce to string for go channel data = string(bodyData) diff --git a/main.go b/main.go @@ -60,6 +60,6 @@ func main() { status = fmt.Sprintf(" %s%s %s%s %s%s %s%s %s %s%s%s", tempIco, weather, homeDir, homeSpace, memIco, ramFree, volIcon, volText, hTime, dropbox, syncthing, rShift) - ui.Tmux(status) // change this to the UI of choice + ui.Dwm(status) // change this to the UI of choice } }