From fdf5ef2555c2b80d651d2e6f26bea7759ef5e73c Mon Sep 17 00:00:00 2001 From: Caleb Bassi Date: Sat, 14 Apr 2018 09:01:15 -0700 Subject: [PATCH] Cleanup --- README.md | 6 +++--- main.go | 2 +- widgets/proc.go | 7 +++++++ 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