From e8d05fa8067df214ba1b20982a27a48070332697 Mon Sep 17 00:00:00 2001 From: alicektx Date: Wed, 9 Sep 2020 16:10:49 +0300 Subject: Update main.go --- cmd/gotop/main.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/gotop/main.go b/cmd/gotop/main.go index c917fc7..fd2dc81 100644 --- a/cmd/gotop/main.go +++ b/cmd/gotop/main.go @@ -65,7 +65,7 @@ func parseArgs() error { versioN := opflag.BoolP("", "V", false, "Print version and exit.") opflag.BoolVarP(&conf.PercpuLoad, "percpu", "p", conf.PercpuLoad, "Show each CPU in the CPU widget.") opflag.BoolVarP(&conf.AverageLoad, "averagecpu", "a", conf.AverageLoad, "Show average CPU in the CPU widget.") - fahrenheit := opflag.BoolP("fahrenheit", "f", conf.TempScale == 'F', "Show temperatures in fahrenheit.Show temperatures in fahrenheit.") + fahrenheit := opflag.BoolP("fahrenheit", "f", conf.TempScale == 'F', "Show temperatures in fahrenheit.") opflag.BoolVarP(&conf.Statusbar, "statusbar", "s", conf.Statusbar, "Show a statusbar with the time.") opflag.DurationVarP(&conf.UpdateInterval, "rate", "r", conf.UpdateInterval, "Refresh frequency. Most time units accepted. `1m` = refresh every minute. `100ms` = refresh every 100ms.") opflag.StringVarP(&conf.Layout, "layout", "l", conf.Layout, `Name of layout spec file for the UI. Use "-" to pipe.`) @@ -506,7 +506,8 @@ const _colorschemes = `Built-in colorschemes: solarized16-dark solarized16-light monokai - vice` + vice + nord` const _widgets = `Widgets that can be used in layouts: cpu - CPU load graph mem - Physical & swap memory use graph -- cgit v1.2.3 From 209e90b31b57ff09581e1b9801848be12b534198 Mon Sep 17 00:00:00 2001 From: Anti Ops <22041463+antiops@users.noreply.github.com> Date: Thu, 19 Nov 2020 01:32:23 -0700 Subject: [docs] Fix links in docs - 3 Links in colorschemes.md lead to the current docs directory instead of its actual directory in the root - 1 link in releasing.md didnt have the corrent linking syntax causing the link to send the uesr to a page that doesnt exist --- docs/colorschemes.md | 4 ++-- docs/releasing.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/colorschemes.md b/docs/colorschemes.md index 430a372..5699432 100644 --- a/docs/colorschemes.md +++ b/docs/colorschemes.md @@ -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/.json` and load it with `gotop -c `. 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/.json` and load it with `gotop -c `. Colorschemes PR's are welcome! To list all built-in color schemes, call: diff --git a/docs/releasing.md b/docs/releasing.md index 8ad4498..bffe175 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -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 -- cgit v1.2.3 From e6447d6dcf3f5e02cd707be13adf2ece08e1cde2 Mon Sep 17 00:00:00 2001 From: Aofei Sheng Date: Sun, 22 Nov 2020 19:19:02 +0800 Subject: Only render mem info when its total > 0 --- widgets/mem.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/widgets/mem.go b/widgets/mem.go index b994276..b6379a9 100644 --- a/widgets/mem.go +++ b/widgets/mem.go @@ -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 { -- cgit v1.2.3