Browse Source

Print all modules data in a loop to the terminal

master
Elis Hirwing 4 years ago
parent
commit
a726e83ca6
Signed by: etu GPG Key ID: D57EFA625C9A925F
  1. 19
      statusscreen.go

19
statusscreen.go

@ -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)
}
}

Loading…
Cancel
Save