Print all modules data in a loop to the terminal

master
Elis Hirwing 2017-11-04 22:02:12 +01:00
parent 0183d7e07c
commit a726e83ca6
Signed by: etu
GPG Key ID: D57EFA625C9A925F
1 changed files with 16 additions and 3 deletions

View File

@ -3,6 +3,7 @@ package main
import (
"fmt"
"github.com/BurntSushi/toml"
tm "github.com/buger/goterm"
"io/ioutil"
"os"
"statusscreen"
@ -16,17 +17,29 @@ func main() {
clock := statusscreen.Clock{Config: &config}
weather := statusscreen.Weather{Config: &config}
tm.Clear()
for {
tm.MoveCursor(1, 1)
for _, row := range clock.GetOutput() {
fmt.Println(row)
tm.Print(row + "\033[K\n")
}
tm.Print("\033[K\n")
for _, row := range weather.GetOutput() {
fmt.Println(row)
tm.Print(row + "\033[K\n")
}
tm.Print("\033[K\n")
for _, row := range sl.GetOutput() {
fmt.Println(row)
tm.Print(row + "\033[K\n")
}
tm.Flush()
time.Sleep(1 * time.Second)
}
}