Browse Source

Print all modules data in a loop to the terminal

master
Elis Hirwing 2 years ago
parent
commit
a726e83ca6
Signed by: etu <elis@hirwing.se> GPG Key ID: D57EFA625C9A925F
1 changed files with 16 additions and 3 deletions
  1. +16
    -3
      statusscreen.go

+ 16
- 3
statusscreen.go 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)
}
}


Loading…
Cancel
Save