1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Add Makefile support for 'make install' and version info

This commit is contained in:
Chris Cummer
2018-04-23 17:35:14 -07:00
parent 34dcdbbe66
commit 5a31de74fe
4 changed files with 39 additions and 14 deletions

View File

@@ -1,7 +1,7 @@
package status
import (
//"fmt"
"fmt"
//"sort"
//"strings"
"time"
@@ -17,12 +17,14 @@ type Widget struct {
wtf.TextWidget
Current int
Version string
}
func NewWidget() *Widget {
func NewWidget(version string) *Widget {
widget := Widget{
TextWidget: wtf.NewTextWidget(" 🎉 Status ", "status"),
Current: 0,
Version: version,
}
return &widget
@@ -35,14 +37,14 @@ func (widget *Widget) Refresh() {
return
}
//_, _, w, _ := widget.View.GetInnerRect()
_, _, w, _ := widget.View.GetInnerRect()
//widget.View.Clear()
//fmt.Fprintf(
//widget.View,
//fmt.Sprintf("\n%%%ds", w-1),
//widget.timezones(),
//)
widget.View.Clear()
fmt.Fprintf(
widget.View,
fmt.Sprintf("\n%%%ds", w-1),
widget.Version,
)
widget.RefreshedAt = time.Now()
}