diff options
author | Jackson Taylor <jtaylormuffins@gmail.com> | 2020-10-02 23:10:52 -0400 |
---|---|---|
committer | Jackson Taylor <jtaylormuffins@gmail.com> | 2020-10-02 23:10:52 -0400 |
commit | 3b25b5bc0254c7462555c9911c67266627428795 (patch) | |
tree | cb01d1fe194999925f452651230d46b1be663d2b | |
parent | cdeb1de96fbd01865497b481aa00c4032c446d66 (diff) |
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | bar.go | 7 | ||||
-rw-r--r-- | config.go | 12 | ||||
-rw-r--r-- | main.go | 1 | ||||
-rw-r--r-- | modules/batteryModule.go (renamed from batteryModule.go) | 3 | ||||
-rw-r--r-- | modules/dateModule.go (renamed from dateModule.go) | 2 | ||||
-rw-r--r-- | modules/module.go (renamed from module.go) | 2 | ||||
-rw-r--r-- | modules/timeModule.go (renamed from timeModule.go) | 2 |
8 files changed, 19 insertions, 11 deletions
@@ -1,2 +1,3 @@ jasbr +# For windows *.exe @@ -1,10 +1,13 @@ package main -import "fmt" +import ( + "fmt" + "github.com/HelixBePraised/jasbr/modules" +) // Bar is the struct that holds each of the modules and displays the data from them type Bar struct { - Modules []Module + Modules []modules.Module } func (b Bar) Display() string { @@ -1,13 +1,17 @@ package main +import ( + "github.com/HelixBePraised/jasbr/modules" +) + // This is the main configuration file for jasbr // You can comment out any modules you don't want to use // you can also add any new ones here that you make // Order does matter // Modules that are displayed in the bar -var BarModules = []Module{ - DateModule{}, - BatteryModule{}, - TimeModule{}, +var BarModules = []modules.Module{ + modules.DateModule{}, + modules.BatteryModule{}, + modules.TimeModule{}, } @@ -16,5 +16,6 @@ func main() { } // Display the bar info to stdout + // TODO: Change this to interact with Xorg directly? fmt.Println(main.Display()) } diff --git a/batteryModule.go b/modules/batteryModule.go index 81fdef0..d4593ff 100644 --- a/batteryModule.go +++ b/modules/batteryModule.go @@ -1,4 +1,4 @@ -package main +package modules import ( "io/ioutil" @@ -7,7 +7,6 @@ import ( // TODO: Move this to a central spot, like a config.h const ( batteryPath = "/sys/class/power_supply/BAT0/capacity" - identifier = "BAT" ) // BatteryModule is the module that controls finding out the battery diff --git a/dateModule.go b/modules/dateModule.go index 1fe60fa..9dec1dd 100644 --- a/dateModule.go +++ b/modules/dateModule.go @@ -1,4 +1,4 @@ -package main +package modules import ( "fmt" diff --git a/module.go b/modules/module.go index 7370452..69e8337 100644 --- a/module.go +++ b/modules/module.go @@ -1,4 +1,4 @@ -package main +package modules // Module is the interface for you to extend what your bar does. type Module interface { diff --git a/timeModule.go b/modules/timeModule.go index da9522b..501b2fe 100644 --- a/timeModule.go +++ b/modules/timeModule.go @@ -1,4 +1,4 @@ -package main +package modules import "time" |