summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaleb Bassi <calebjbassi@gmail.com>2018-04-14 09:01:15 -0700
committerCaleb Bassi <calebjbassi@gmail.com>2018-04-14 09:02:26 -0700
commitfdf5ef2555c2b80d651d2e6f26bea7759ef5e73c (patch)
tree68dbc6d6f628ec8622a716ae4aa5962ff8d354ff
parent4d809023d356c6094725d6558c2c5757075c7234 (diff)
Cleanup
-rw-r--r--README.md6
-rw-r--r--main.go2
-rw-r--r--widgets/proc.go7
3 files changed, 11 insertions, 4 deletions
diff --git a/README.md b/README.md
index 681fc26..a1aad8c 100644
--- a/README.md
+++ b/README.md
@@ -85,11 +85,11 @@ Feel free to add a new one. You can use 256 colors, bold, underline, and reverse
## Built With
-* [A termui fork](https://github.com/cjbassi/termui)
-* [drawille-go](https://github.com/exrook/drawille-go)
+* [My termui fork](https://github.com/cjbassi/termui)
+ * [drawille-go](https://github.com/exrook/drawille-go)
+ * [termbox](https://github.com/nsf/termbox-go)
* [gopsutil](https://github.com/shirou/gopsutil)
* [goreleaser](https://github.com/goreleaser/goreleaser)
-* [termbox](https://github.com/nsf/termbox-go)
## Stargazers over time
diff --git a/main.go b/main.go
index ebc0cd3..8bffecd 100644
--- a/main.go
+++ b/main.go
@@ -285,7 +285,7 @@ func main() {
}
}()
- // handles os kill signal
+ // handles kill signal sent to gotop
c := make(chan os.Signal, 2)
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
go func() {
diff --git a/widgets/proc.go b/widgets/proc.go
index 89ef58c..bf41dfb 100644
--- a/widgets/proc.go
+++ b/widgets/proc.go
@@ -7,15 +7,22 @@ import (
"time"
ui "github.com/cjbassi/termui"
+ "github.com/mattn/go-runewidth"
psCPU "github.com/shirou/gopsutil/cpu"
psProc "github.com/shirou/gopsutil/process"
)
+var arrowWidth int
+
const (
UP = "▲"
DOWN = "▼"
)
+func init() {
+ arrowWidth = runewidth.StringWidth(UP)
+}
+
// Process represents each process.
type Process struct {
PID int32