summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--bar.go7
-rw-r--r--config.go12
-rw-r--r--main.go1
-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
diff --git a/.gitignore b/.gitignore
index 77dc878..6369cac 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
jasbr
+# For windows
*.exe
diff --git a/bar.go b/bar.go
index 510d292..a2a9d3c 100644
--- a/bar.go
+++ b/bar.go
@@ -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 {
diff --git a/config.go b/config.go
index 27badc9..ca73a6c 100644
--- a/config.go
+++ b/config.go
@@ -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{},
}
diff --git a/main.go b/main.go
index 87ca582..6ebbad4 100644
--- a/main.go
+++ b/main.go
@@ -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"