Skip to content

Commit

Permalink
Merge branch 'master' of github.com:xxxserxxx/gotop
Browse files Browse the repository at this point in the history
Re-implements doc fixes and updates static data go:generate
  • Loading branch information
xxxserxxx committed Nov 23, 2020
2 parents daf5916 + a8a238a commit c5a8d0f
Show file tree
Hide file tree
Showing 10 changed files with 57 additions and 22 deletions.
2 changes: 1 addition & 1 deletion devices/smc.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/colorschemes.md
Original file line number Diff line number Diff line change
@@ -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:

Expand Down
2 changes: 1 addition & 1 deletion docs/releasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand All @@ -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=
Expand All @@ -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=
39 changes: 31 additions & 8 deletions translations/dicts.go

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions translations/dicts/de_DE.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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."
Expand Down
5 changes: 3 additions & 2 deletions translations/dicts/en_US.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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."
Expand Down
3 changes: 2 additions & 1 deletion translations/dicts/eo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion translations/dicts/zh_CN.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ colorschemes = """内建配色方案:
solarized16-dark
solarized16-light
monokai
vice"""
vice
nord"""
# TRANSLATORS: Please don't translate the widget **names**
widgets = """可被用于布局方案的组件名:
cpu - CPU 负载图
Expand Down
12 changes: 8 additions & 4 deletions widgets/mem.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,20 @@ 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() {
for range time.NewTicker(widg.updateInterval).C {
widg.Lock()
devices.UpdateMem(mems)
for label, mi := range mems {
widg.renderMemInfo(label, mi)
if mi.Total > 0 {
widg.renderMemInfo(label, mi)
}
}
widg.Unlock()
}
Expand All @@ -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 {
Expand Down

0 comments on commit c5a8d0f

Please sign in to comment.