summaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
authorSean E. Russell <ser@ser1.net>2020-04-23 10:41:20 -0500
committerSean E. Russell <ser@ser1.net>2020-04-23 10:41:20 -0500
commit5ada5315d940038fcd83777b1e73797bbbada108 (patch)
tree14af5297197ecc43e50ff7cafa8154fda55dd72f /widgets
parent3fcab5a42054c84895c4f6da5097360d35414fde (diff)
Fixes #92, configurable temps; help text & docs clean-up; versions are now built into binaries at compile time; clean up old extensions params; adds --list command; adds --write-config command; fixes bug in colorscheme loading; fixes bug in Colorschemes -- all had empty Name attrs; adds ability to list devices.
Diffstat (limited to 'widgets')
-rw-r--r--widgets/disk.go2
-rw-r--r--widgets/temp.go11
2 files changed, 12 insertions, 1 deletions
diff --git a/widgets/disk.go b/widgets/disk.go
index b53df9d..e2b3eb2 100644
--- a/widgets/disk.go
+++ b/widgets/disk.go
@@ -32,6 +32,8 @@ type DiskWidget struct {
metric map[string]prometheus.Gauge
}
+// TODO: Add filtering
+// TODO: Abstract out device from widget
func NewDiskWidget() *DiskWidget {
self := &DiskWidget{
Table: ui.NewTable(),
diff --git a/widgets/temp.go b/widgets/temp.go
index 1b9f650..3e1b067 100644
--- a/widgets/temp.go
+++ b/widgets/temp.go
@@ -32,7 +32,7 @@ type TempWidget struct {
}
// TODO: state:deferred 156 Added temperatures for NVidia GPUs (azak-azkaran/master). Crashes on non-nvidia machines.
-func NewTempWidget(tempScale TempScale) *TempWidget {
+func NewTempWidget(tempScale TempScale, filter []string) *TempWidget {
self := &TempWidget{
Block: ui.NewBlock(),
updateInterval: time.Second * 5,
@@ -41,6 +41,15 @@ func NewTempWidget(tempScale TempScale) *TempWidget {
TempScale: tempScale,
}
self.Title = " Temperatures "
+ if len(filter) > 0 {
+ for _, t := range filter {
+ self.Data[t] = 0
+ }
+ } else {
+ for _, t := range devices.Devices(devices.Temperatures) {
+ self.Data[t] = 0
+ }
+ }
if tempScale == Fahrenheit {
self.TempThreshold = utils.CelsiusToFahrenheit(self.TempThreshold)