Fixed colorschemes
This commit is contained in:
parent
88dbb6a453
commit
8531e40b09
|
@ -73,7 +73,7 @@ Feel free to add a new one. You can use 256 colors, bold, underline, and reverse
|
|||
* CPU Usage
|
||||
- support colors for more CPU cores
|
||||
* themes
|
||||
- solarized picture and theme
|
||||
- solarized picture
|
||||
- copy over vtop themes
|
||||
* general
|
||||
- command line option to set polling interval for CPU and mem
|
||||
|
|
|
@ -4,6 +4,7 @@ var DefaultCS = Colorscheme{
|
|||
Name: "Default",
|
||||
Author: "Caleb Bassi",
|
||||
|
||||
Fg: 7,
|
||||
Bg: -1,
|
||||
|
||||
BorderLabel: 7,
|
||||
|
|
|
@ -20,6 +20,7 @@ type Colorscheme struct {
|
|||
Name string
|
||||
Author string
|
||||
|
||||
Fg int
|
||||
Bg int
|
||||
|
||||
BorderLabel int
|
||||
|
@ -36,6 +37,7 @@ type Colorscheme struct {
|
|||
|
||||
DiskBar int
|
||||
|
||||
// Temperature colors depending on if it's over a certain threshold
|
||||
TempLow int
|
||||
TempHigh int
|
||||
}
|
||||
|
|
6
gotop.go
6
gotop.go
|
@ -118,10 +118,12 @@ func keyBinds() {
|
|||
}
|
||||
|
||||
func termuiColors() {
|
||||
ui.Theme.Fg = ui.Color(7)
|
||||
ui.Theme.Fg = ui.Color(colorscheme.Fg)
|
||||
ui.Theme.Bg = ui.Color(colorscheme.Bg)
|
||||
ui.Theme.BorderBg = ui.Color(colorscheme.Bg)
|
||||
ui.Theme.LabelFg = ui.Color(colorscheme.BorderLabel)
|
||||
ui.Theme.LabelBg = ui.Color(colorscheme.Bg)
|
||||
ui.Theme.BorderFg = ui.Color(colorscheme.BorderLine)
|
||||
ui.Theme.BorderBg = ui.Color(colorscheme.Bg)
|
||||
|
||||
ui.Theme.TableCursor = ui.Color(colorscheme.ProcCursor)
|
||||
ui.Theme.Sparkline = ui.Color(colorscheme.Sparkline)
|
||||
|
|
|
@ -29,13 +29,13 @@ func (bc *List) Buffer() *Buffer {
|
|||
if y+1 > bc.Y {
|
||||
break
|
||||
}
|
||||
bg := Theme.TempLow
|
||||
fg := Theme.TempLow
|
||||
if bc.Data[y] >= bc.Threshold {
|
||||
bg = Theme.TempHigh
|
||||
fg = Theme.TempHigh
|
||||
}
|
||||
r := MaxString(text, (bc.X - 4))
|
||||
buf.SetString(1, y+1, r, Color(7), bc.Bg)
|
||||
buf.SetString(bc.X-2, y+1, fmt.Sprintf("%dC", bc.Data[y]), bg, bc.Bg)
|
||||
buf.SetString(1, y+1, r, Theme.Fg, bc.Bg)
|
||||
buf.SetString(bc.X-2, y+1, fmt.Sprintf("%dC", bc.Data[y]), fg, bc.Bg)
|
||||
}
|
||||
|
||||
return buf
|
||||
|
|
Loading…
Reference in New Issue
Block a user