Code cleanup and updated README

This commit is contained in:
Caleb Bassi 2018-02-25 22:51:51 -08:00
parent 21aed4b1ea
commit 6c1848eea7
6 changed files with 17 additions and 15 deletions

View File

@ -12,18 +12,18 @@ Built with [gopsutil](https://github.com/shirou/gopsutil), [drawille-go](https:/
Binaries are currently available for 32/64bit Linux and 64bit OSX.
To download the latest binary for your system from GitHub, you can run the [install](https://github.com/cjbassi/gotop/blob/master/install.sh) script:
To download the latest binary for your system from GitHub, you can run the [download](https://github.com/cjbassi/gotop/blob/master/download.sh) script:
```
curl https://raw.githubusercontent.com/cjbassi/gotop/master/install.sh | bash
curl https://raw.githubusercontent.com/cjbassi/gotop/master/download.sh | bash
```
Then move `gotop` somewhere into your $PATH.
Then move `gotop` into your $PATH somewhere.
### Arch Linux
Alternatively, if you're on Arch Linux you can install the `gotop` package from the AUR.
If you're running Arch Linux, you can install the `gotop` package from the AUR.
### Source
@ -54,7 +54,7 @@ go get github.com/cjbassi/gotop
### Mouse
* click to select process
* mouse wheel to scroll Process List
* mouse wheel to scroll through processes
## Colorschemes
@ -73,8 +73,8 @@ Feel free to add a new one. You can use 256 colors, bold, underline, and reverse
- command line option to set polling interval for CPU and mem
- command line option to only show processes, CPU, and mem
- zooming in and out of graphs
- gopsutil issue for darwin i386
* cleaning up code
- gopsutil cross-compiling issue on Linux amd64 for darwin i386
* code cleanup
- termui buffers should ignore setting characters outside the widget area
- ignore writes or give an error?
- termui Blocks should be indexed at 0, and maybe change their X and Y variables too

View File

@ -7,7 +7,7 @@ var Monokai = Colorscheme{
BorderLabel: 249,
BorderLine: 239,
CPULines: []int{208, 70, 197, 81, 249, 141, 221, 186},
CPULines: []int{197, 208, 70, 81, 249, 141, 221, 186},
MainMem: 208,
SwapMem: 186,

View File

@ -26,7 +26,7 @@ var DefaultTheme = Colorscheme{
BorderBg: -1,
Sparkline: 4,
LineGraph: -1,
LineGraph: 0,
TableCursor: 4,
GaugeColor: 7,
}

View File

@ -16,8 +16,8 @@ type Table struct {
UniqueCol int // the column used to identify the selected item
SelectedItem string // used to keep the cursor on the correct item if the data changes
SelectedRow int
TopRow int // used to indicate where in the table we are scrolled at
ColResizer func()
TopRow int // used to indicate where in the table we are scrolled at
ColResizer func() // for widgets that inherit a Table and want to overload the ColResize method
}
// NewTable returns a new Table instance
@ -104,8 +104,9 @@ func (t *Table) Buffer() *Buffer {
return buf
}
////////////////////////////////////////////////////////////////////////////////
// Cursor movement
/////////////////////////////////////////////////////////////////////////////////
// Cursor Movement //
/////////////////////////////////////////////////////////////////////////////////
// calcPos is used to calculate the cursor position and where in the process list we are located.
func (t *Table) calcPos() {

View File

@ -292,8 +292,9 @@ func (p *Proc) Kill() {
cmd.Start()
}
////////////////////////////////////////////////////////////////////////////////
// Sorting
/////////////////////////////////////////////////////////////////////////////////
// []Process Sorting //
/////////////////////////////////////////////////////////////////////////////////
type ProcessByCPU []Process