Merge pull request #213 from quantonganh/174-upload-download-different-colors

Different colors for download/upload
This commit is contained in:
xxxserxxx 2022-03-27 10:26:28 -05:00 committed by GitHub
commit 4f31421019
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 23 additions and 16 deletions

View File

@ -20,7 +20,7 @@ The keys are:
BattLines -- array of ints for the colors of lines
MemLines -- array of ints for the colors of lines
ProcCursor -- int, color of the cursor in the process widget
Sparkline -- int, color of the graph bars
Sparklines -- array of ints for the colors of network usage
DiskBar -- int, color of the disk bars
TempLow -- int, color used for low temperatures
TempHigh -- int, color used for high temperatures

View File

@ -16,7 +16,7 @@ func init() {
ProcCursor: 4,
Sparkline: 4,
Sparklines: [2]int{4, 5},
DiskBar: 7,

View File

@ -15,7 +15,7 @@
"ProcCursor": 4,
"Sparkline": 4,
"Sparklines": [4, 5],
"DiskBar": 7,

View File

@ -16,7 +16,7 @@ func init() {
ProcCursor: 33,
Sparkline: 4,
Sparklines: [2]int{4, 5},
DiskBar: 252,

View File

@ -16,7 +16,7 @@ func init() {
ProcCursor: 197,
Sparkline: 81,
Sparklines: [2]int{81, 186},
DiskBar: 102,

View File

@ -29,7 +29,7 @@ func init() {
ProcCursor: 31, // blue (nord9)
Sparkline: 31,
Sparklines: [2]int{31, 96},
DiskBar: 254,

View File

@ -19,7 +19,7 @@ func init() {
ProcCursor: 136,
Sparkline: 33,
Sparklines: [2]int{33, 136},
DiskBar: 243,

View File

@ -18,7 +18,7 @@ func init() {
ProcCursor: 4,
Sparkline: 4,
Sparklines: [2]int{4, 5},
DiskBar: 12, // base0

View File

@ -18,7 +18,7 @@ func init() {
ProcCursor: 4,
Sparkline: 4,
Sparklines: [2]int{4, 5},
DiskBar: 11, // base00

View File

@ -52,8 +52,8 @@ type Colorscheme struct {
// ProcCursor is used as the color for the color bar in the process widget
ProcCursor int
// SparkLine determines the color of the data line in spark graphs
Sparkline int
// SparkLines define the colors used for the Network usage graphs
Sparklines [2]int
// DiskBar is the color of the disk gauge bars (currently unused,
// as there's no disk gauge widget)

View File

@ -16,7 +16,7 @@ func init() {
ProcCursor: 159,
Sparkline: 183,
Sparklines: [2]int{183, 146},
DiskBar: 158,

View File

@ -1,3 +1,4 @@
//go:build darwin
// +build darwin
package devices
@ -5,13 +6,18 @@ package devices
import (
"bytes"
"encoding/csv"
"io"
"log"
"testing"
)
func Test_NumCols(t *testing.T) {
parser := csv.NewReader(bytes.NewReader(smcData))
parser.Comma = '\t'
var line []string
var (
line []string
err error
)
for {
if line, err = parser.Read(); err == io.EOF {
break
@ -23,7 +29,7 @@ func Test_NumCols(t *testing.T) {
// The line is malformed if len(line) != 2, but because the asset is static
// it makes no sense to report the error to downstream users. This must be
// tested at/around compile time.
if len(line) == 2 {
if len(line) != 2 {
t.Errorf("smc CSV data malformed: expected 2 columns, got %d", len(line))
}
}

View File

@ -6,6 +6,7 @@ import (
"strings"
"github.com/xxxserxxx/lingo/v2"
"github.com/xxxserxxx/gotop/v4"
"github.com/xxxserxxx/gotop/v4/widgets"
@ -186,9 +187,9 @@ func makeWidget(c gotop.Config, widRule widgetRule) interface{} {
w = t
case "net":
n := widgets.NewNetWidget(c.NetInterface)
n.Lines[0].LineColor = ui.Color(c.Colorscheme.Sparkline)
n.Lines[0].LineColor = ui.Color(c.Colorscheme.Sparklines[0])
n.Lines[0].TitleColor = ui.Color(c.Colorscheme.BorderLabel)
n.Lines[1].LineColor = ui.Color(c.Colorscheme.Sparkline)
n.Lines[1].LineColor = ui.Color(c.Colorscheme.Sparklines[1])
n.Lines[1].TitleColor = ui.Color(c.Colorscheme.BorderLabel)
n.Mbps = c.Mbps
w = n