You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

main.go 1.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. package main
  2. import (
  3. "./src/clock"
  4. "./src/config"
  5. "./src/pollen"
  6. "./src/sl"
  7. "./src/watersensor"
  8. "./src/weather"
  9. tm "github.com/buger/goterm"
  10. "time"
  11. )
  12. func main() {
  13. config := config.New("status.toml")
  14. clock := clock.Clock{Config: &config}
  15. pollen := pollen.Pollen{Config: &config}
  16. sl := sl.SL{Config: &config}
  17. watersensor := watersensor.Watersensor{Config: &config}
  18. weather := weather.Weather{Config: &config}
  19. tm.Clear()
  20. tm.Print("\033[?25l")
  21. for {
  22. tm.MoveCursor(1, 1)
  23. for _, row := range clock.GetOutput() {
  24. tm.Print(row + "\033[K\n")
  25. }
  26. tm.Print("\033[K\n")
  27. for _, row := range weather.GetOutput() {
  28. tm.Print(row + "\033[K\n")
  29. }
  30. tm.Print("\033[K\n")
  31. for _, row := range pollen.GetOutput() {
  32. tm.Print(row + "\033[K\n")
  33. }
  34. tm.Print("\033[K\n")
  35. for _, row := range watersensor.GetOutput() {
  36. tm.Print(row + "\033[K\n")
  37. }
  38. tm.Print("\033[K\n")
  39. for _, row := range sl.GetOutput() {
  40. tm.Print(row + "\033[K\n")
  41. }
  42. tm.Print("\033[J")
  43. tm.Flush()
  44. time.Sleep(time.Second / 10)
  45. }
  46. }