Merge branch 'master' of github.com:xxxserxxx/gotop

Re-implements doc fixes and updates static data go:generate
This commit is contained in:
Sean E. Russell 2020-11-23 15:14:57 -06:00
commit c5a8d0f32f
10 changed files with 57 additions and 22 deletions

View File

@ -93,7 +93,7 @@ func smcTsv() (*asset, error) {
return nil, err
}
info := bindataFileInfo{name: "smc.tsv", size: 3398, mode: os.FileMode(420), modTime: time.Unix(1592515411, 0)}
info := bindataFileInfo{name: "smc.tsv", size: 3398, mode: os.FileMode(420), modTime: time.Unix(1592914957, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}

View File

@ -1,8 +1,8 @@
# Colorschemes
gotop ships with a few colorschemes which can be set with the `-c` flag followed by the name of one. You can find all the colorschemes in the [colorschemes folder](./colorschemes).
gotop ships with a few colorschemes which can be set with the `-c` flag followed by the name of one. You can find all the colorschemes in the [colorschemes folder](../colorschemes).
To make a custom colorscheme, check out the [template](./colorschemes/template.go) for instructions and then use [default.json](./colorschemes/default.json) as a starter. Then put the file at `~/.config/gotop/<name>.json` and load it with `gotop -c <name>`. Colorschemes PR's are welcome!
To make a custom colorscheme, check out the [template](../colorschemes/template.go) for instructions and then use [default.json](../colorschemes/default.json) as a starter. Then put the file at `~/.config/gotop/<name>.json` and load it with `gotop -c <name>`. Colorschemes PR's are welcome!
To list all built-in color schemes, call:

View File

@ -8,7 +8,7 @@
6. Download and verify the correct version of one of the binaries
7. Finish the draft release and publish.
8. Check gotop-builder for a successful everything build; if successful, publish.
10. Wait for the [AUR](https://github.com/xxxserxxx/gotop-linux] project to finish building.
10. Wait for the [AUR](https://github.com/xxxserxxx/gotop-linux) project to finish building.
1. update arch (gotop-linux) and run `aurpublish gotop` and `aurpublish gotop-bin`
2. Test install `gotop` and `gotop-bin` with running & version check
11. Notify Nix

4
go.sum
View File

@ -10,6 +10,7 @@ github.com/cjbassi/drawille-go v0.0.0-20190126131713-27dc511fe6fd h1:XtfPmj9tQRi
github.com/cjbassi/drawille-go v0.0.0-20190126131713-27dc511fe6fd/go.mod h1:vjcQJUZJYD3MeVGhtZXSMnCHfUNZxsyYzJt90eCYxK4=
github.com/cloudfoundry-attic/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21 h1:Yg2hDs4b13Evkpj42FU2idX2cVXVFqQSheXYKM86Qsk=
github.com/cloudfoundry-attic/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21/go.mod h1:MgJyK38wkzZbiZSKeIeFankxxSA8gayko/nr5x5bgBA=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/distatus/battery v0.9.0 h1:8NS5o00/j3Oh2xgocA6pQROTp5guoR+s8CZlWzHC4QM=
github.com/distatus/battery v0.9.0/go.mod h1:gGO7GxHTi1zlRT+cAj8uGG0/8HFiqAeH0TJvoipnuPs=
@ -32,12 +33,14 @@ github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZX
github.com/nsf/termbox-go v0.0.0-20190121233118-02980233997d/go.mod h1:IuKpRQcYE1Tfu+oAQqaLisqDeXgjyyltCfsaoYN18NQ=
github.com/nsf/termbox-go v0.0.0-20200418040025-38ba6e5628f1 h1:lh3PyZvY+B9nFliSGTn5uFuqQQJGuNrD0MLCokv09ag=
github.com/nsf/termbox-go v0.0.0-20200418040025-38ba6e5628f1/go.mod h1:IuKpRQcYE1Tfu+oAQqaLisqDeXgjyyltCfsaoYN18NQ=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/shibukawa/configdir v0.0.0-20170330084843-e180dbdc8da0 h1:Xuk8ma/ibJ1fOy4Ee11vHhUFHQNpHhrBneOCNHVXS5w=
github.com/shibukawa/configdir v0.0.0-20170330084843-e180dbdc8da0/go.mod h1:7AwjWCpdPhkSmNAgUv5C7EJ4AbmjEB3r047r3DXWu3Y=
github.com/shirou/gopsutil v2.20.3+incompatible h1:0JVooMPsT7A7HqEYdydp/OfjSOYSjhXV7w1hkKj/NPQ=
github.com/shirou/gopsutil v2.20.3+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/valyala/fastrand v1.0.0 h1:LUKT9aKer2dVQNUi3waewTbKV+7H17kvWFNKs2ObdkI=
github.com/valyala/fastrand v1.0.0/go.mod h1:HWqCzkrkg6QXT8V2EXWvXCoow7vLwOFN002oeRzjapQ=
@ -54,6 +57,7 @@ golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7w
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
howett.net/plist v0.0.0-20200419221736-3b63eb3a43b5 h1:AQkaJpH+/FmqRjmXZPELom5zIERYZfwTjnHpfoVMQEc=
howett.net/plist v0.0.0-20200419221736-3b63eb3a43b5/go.mod h1:vMygbs4qMhSZSc4lCUl2OEE+rDiIIJAIdR4m7MiMcm0=

File diff suppressed because one or more lines are too long

View File

@ -58,7 +58,8 @@ colorschemes = """Built-in colorschemes:
solarized16-dark
solarized16-light
monokai
vice"""
vice
nord"""
# TRANSLATORS: Please don't translate the widget **names**
widgets = """Widgets that can be used in layouts:
cpu - CPU load graph
@ -77,7 +78,7 @@ scale="Stellen den Skalierungsfaktor ein, >0"
version="Zeigen die Version aus und beenden."
percpu="Show each CPU in the CPU widget."
cpuavg="Show average CPU in the CPU widget."
temp="Show temperatures in fahrenheit.Show temperatures in fahrenheit."
temp="Show temperatures in fahrenheit."
statusbar="Show a statusbar with the time."
rate="Refresh frequency. Most time units accepted. \"1m\" = refresh every minute. \"100ms\" = refresh every 100ms."
layout="Name of layout spec file for the UI. Use \"-\" to pipe."

View File

@ -58,7 +58,8 @@ colorschemes = """Built-in colorschemes:
solarized16-dark
solarized16-light
monokai
vice"""
vice
nord"""
# TRANSLATORS: Please don't translate the widget **names**
widgets = """Widgets that can be used in layouts:
cpu - CPU load graph
@ -77,7 +78,7 @@ scale="Graph scale factor, >0"
version="Print version and exit."
percpu="Show each CPU in the CPU widget."
cpuavg="Show average CPU in the CPU widget."
temp="Show temperatures in fahrenheit.Show temperatures in fahrenheit."
temp="Show temperatures in fahrenheit."
statusbar="Show a statusbar with the time."
rate="Refresh frequency. Most time units accepted. \"1m\" = refresh every minute. \"100ms\" = refresh every 100ms."
layout="Name of layout spec file for the UI. Use \"-\" to pipe."

View File

@ -58,7 +58,8 @@ colorschemes = """Enkonstruitaj kloraj skemoj:
solarized16-dark
solarized16-light
monokai
vice"""
vice
nord"""
# TRANSLATORS: Please don't translate the widget **names**
widgets = """Enpaĝigaj Fenestraĵoj:
cpu - CPU ŝarĝa grafilo

View File

@ -58,7 +58,8 @@ colorschemes = """内建配色方案:
solarized16-dark
solarized16-light
monokai
vice"""
vice
nord"""
# TRANSLATORS: Please don't translate the widget **names**
widgets = """:
cpu - CPU

View File

@ -26,8 +26,10 @@ func NewMemWidget(updateInterval time.Duration, horizontalScale int) *MemWidget
mems := make(map[string]devices.MemoryInfo)
devices.UpdateMem(mems)
for name, mem := range mems {
widg.Data[name] = []float64{0}
widg.renderMemInfo(name, mem)
if mem.Total > 0 {
widg.Data[name] = []float64{0}
widg.renderMemInfo(name, mem)
}
}
go func() {
@ -35,7 +37,9 @@ func NewMemWidget(updateInterval time.Duration, horizontalScale int) *MemWidget
widg.Lock()
devices.UpdateMem(mems)
for label, mi := range mems {
widg.renderMemInfo(label, mi)
if mi.Total > 0 {
widg.renderMemInfo(label, mi)
}
}
widg.Unlock()
}
@ -47,7 +51,7 @@ func NewMemWidget(updateInterval time.Duration, horizontalScale int) *MemWidget
func (mem *MemWidget) EnableMetric() {
mems := make(map[string]devices.MemoryInfo)
devices.UpdateMem(mems)
for l, _ := range mems {
for l := range mems {
lc := l
metrics.NewGauge(makeName("memory", l), func() float64 {
if ds, ok := mem.Data[lc]; ok {