Print all modules data in a loop to the terminal
parent
0183d7e07c
commit
a726e83ca6
|
@ -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…
Reference in New Issue