From 203575b1f97501fd190bea67c11552f0635faa8d Mon Sep 17 00:00:00 2001 From: Jackson Taylor Date: Wed, 8 Apr 2020 17:47:08 -0400 Subject: Make Bar its own file Add bar.go Add refresh rate to bar struct --- main.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index dfaad2a..ef2df15 100644 --- a/main.go +++ b/main.go @@ -10,27 +10,23 @@ import ( "fmt" // "os" "os/exec" - // "time" + "time" ) -// Bar is the struct that holds each of the modules and displays the data from them -type Bar struct { - Modules []Module -} - type Module interface { GetInfo() (string, error) } +// Modules that are displayed in the bar var BarModules = []Module{ DateModule{}, BatteryModule{}, } func main() { - main := Bar{ - Modules: BarModules, + Modules: BarModules, + RefreshRate: time.Second * 1, } fmt.Println("Bar Started") -- cgit v1.2.3