diff options
author | Caleb Bassi <calebjbassi@gmail.com> | 2018-09-18 13:42:49 -0700 |
---|---|---|
committer | Caleb Bassi <calebjbassi@gmail.com> | 2018-09-18 13:42:49 -0700 |
commit | db1b2fbc70536b0b7ad8f36b1fdee297094eb139 (patch) | |
tree | 8992fe9396ce0dbeafde99ecd671eb5ae21d78a7 /colorschemes | |
parent | bb36706e866475e65f1629466e0ea202223afc01 (diff) |
Add custom colorscheme loading. Closes #55
Diffstat (limited to 'colorschemes')
-rw-r--r-- | colorschemes/default.go | 23 | ||||
-rw-r--r-- | colorschemes/default.json | 23 | ||||
-rw-r--r-- | colorschemes/default_dark.go | 23 | ||||
-rw-r--r-- | colorschemes/monokai.go | 23 | ||||
-rw-r--r-- | colorschemes/monokai.png | bin | 0 -> 93386 bytes | |||
-rw-r--r-- | colorschemes/solarized.go | 23 | ||||
-rw-r--r-- | colorschemes/solarized.png | bin | 0 -> 88930 bytes | |||
-rw-r--r-- | colorschemes/template.go | 45 |
8 files changed, 160 insertions, 0 deletions
diff --git a/colorschemes/default.go b/colorschemes/default.go new file mode 100644 index 0000000..48db2d3 --- /dev/null +++ b/colorschemes/default.go @@ -0,0 +1,23 @@ +package colorschemes + +var Default = Colorscheme{ + Fg: 7, + Bg: -1, + + BorderLabel: 7, + BorderLine: 6, + + CPULines: []int{4, 3, 2, 1, 5, 6, 7, 8}, + + MainMem: 5, + SwapMem: 11, + + ProcCursor: 4, + + Sparkline: 4, + + DiskBar: 7, + + TempLow: 2, + TempHigh: 1, +} diff --git a/colorschemes/default.json b/colorschemes/default.json new file mode 100644 index 0000000..5d26a8b --- /dev/null +++ b/colorschemes/default.json @@ -0,0 +1,23 @@ +// Example json file to put in `~/.config/gotop/{name}.json` and load with +// `gotop -c {name}`. MUST DELETE THESE COMMENTS in order to load. +{ + "Fg": 7, + "Bg": -1, + + "BorderLabel": 7, + "BorderLine": 6, + + "CPULines": [4, 3, 2, 1, 5, 6, 7, 8], + + "MainMem": 5, + "SwapMem": 11, + + "ProcCursor": 4, + + "Sparkline": 4, + + "DiskBar": 7, + + "TempLow": 2, + "TempHigh": 1 +} diff --git a/colorschemes/default_dark.go b/colorschemes/default_dark.go new file mode 100644 index 0000000..15f7137 --- /dev/null +++ b/colorschemes/default_dark.go @@ -0,0 +1,23 @@ +package colorschemes + +var DefaultDark = Colorscheme{ + Fg: 235, + Bg: -1, + + BorderLabel: 235, + BorderLine: 6, + + CPULines: []int{4, 3, 2, 1, 5, 6, 7, 8}, + + MainMem: 5, + SwapMem: 3, + + ProcCursor: 33, + + Sparkline: 4, + + DiskBar: 252, + + TempLow: 2, + TempHigh: 1, +} diff --git a/colorschemes/monokai.go b/colorschemes/monokai.go new file mode 100644 index 0000000..b3dbc23 --- /dev/null +++ b/colorschemes/monokai.go @@ -0,0 +1,23 @@ +package colorschemes + +var Monokai = Colorscheme{ + Fg: 249, + Bg: -1, + + BorderLabel: 249, + BorderLine: 239, + + CPULines: []int{81, 70, 208, 197, 249, 141, 221, 186}, + + MainMem: 208, + SwapMem: 186, + + ProcCursor: 197, + + Sparkline: 81, + + DiskBar: 102, + + TempLow: 70, + TempHigh: 208, +} diff --git a/colorschemes/monokai.png b/colorschemes/monokai.png Binary files differnew file mode 100644 index 0000000..468d2b2 --- /dev/null +++ b/colorschemes/monokai.png diff --git a/colorschemes/solarized.go b/colorschemes/solarized.go new file mode 100644 index 0000000..2ead4df --- /dev/null +++ b/colorschemes/solarized.go @@ -0,0 +1,23 @@ +package colorschemes + +var Solarized = Colorscheme{ + Fg: 250, + Bg: -1, + + BorderLabel: 250, + BorderLine: 37, + + CPULines: []int{61, 33, 37, 64, 125, 160, 166, 136}, + + MainMem: 125, + SwapMem: 166, + + ProcCursor: 136, + + Sparkline: 33, + + DiskBar: 245, + + TempLow: 64, + TempHigh: 160, +} diff --git a/colorschemes/solarized.png b/colorschemes/solarized.png Binary files differnew file mode 100644 index 0000000..b697919 --- /dev/null +++ b/colorschemes/solarized.png diff --git a/colorschemes/template.go b/colorschemes/template.go new file mode 100644 index 0000000..d303e4b --- /dev/null +++ b/colorschemes/template.go @@ -0,0 +1,45 @@ +package colorschemes + +/* + The standard 256 terminal colors are supported. + + -1 = clear + + You can combine a color with 'Bold', 'Underline', or 'Reverse' by using bitwise OR ('|') and the name of the attribute. + For example, to get Bold red Labels, you would do 'Labels: 2 | Bold'. + + Once you've created a colorscheme, add an entry for it in the `handleColorscheme` function in 'main.go'. +*/ + +const ( + Bold int = 1 << (iota + 9) + Underline + Reverse +) + +type Colorscheme struct { + Name string + Author string + + Fg int + Bg int + + BorderLabel int + BorderLine int + + // should add at least 8 here + CPULines []int + + MainMem int + SwapMem int + + ProcCursor int + + Sparkline int + + DiskBar int + + // colors the temperature number a different color if it's over a certain threshold + TempLow int + TempHigh int +} |