Merge branch 'master' into nvidia
@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## [3.3.2] - ??
|
## [3.3.2] - ??
|
||||||
|
|
||||||
|
- Fixes #15, crash caused by battery widget when some accessories have batteries
|
||||||
- Fixes #57, colors with dashes in the name not found.
|
- Fixes #57, colors with dashes in the name not found.
|
||||||
- Also, cjbassi/gotop#127 and cjbassi/gotop#130 were released back in v3.1.0.
|
- Also, cjbassi/gotop#127 and cjbassi/gotop#130 were released back in v3.1.0.
|
||||||
|
|
||||||
|
17
README.md
@ -9,8 +9,8 @@ Another terminal based graphical activity monitor, inspired by [gtop](https://gi
|
|||||||
|
|
||||||
The original author of gotop has re-implemented the application in Rust, as [ytop](https://github.com/cjbassi/ytop). This is a fork of original gotop project with a new maintainer.
|
The original author of gotop has re-implemented the application in Rust, as [ytop](https://github.com/cjbassi/ytop). This is a fork of original gotop project with a new maintainer.
|
||||||
|
|
||||||
<img src="./assets/demos/demo.gif" />
|
<img src="./assets/screenshots/demo.gif" />
|
||||||
<img src="./assets/screenshots/minimal.png" width="96%" />
|
<img src="./assets/screenshots/kitchensink.gif" />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -166,14 +166,14 @@ build massive edifices, you're in for disappointment.
|
|||||||
### CLI Options
|
### CLI Options
|
||||||
|
|
||||||
`-c`, `--color=NAME` Set a colorscheme.
|
`-c`, `--color=NAME` Set a colorscheme.
|
||||||
`-m`, `--minimal` Only show CPU, Mem and Process widgets. (DEPRECATED for `-l minimal`)
|
`-m`, `--minimal` Only show CPU, Mem and Process widgets. (DEPRECATED, use `-l minimal`)
|
||||||
`-r`, `--rate=RATE` Number of times per second to update CPU and Mem widgets [default: 1].
|
`-r`, `--rate=RATE` Number of times per second to update CPU and Mem widgets [default: 1].
|
||||||
`-V`, `--version` Print version and exit.
|
`-V`, `--version` Print version and exit.
|
||||||
`-p`, `--percpu` Show each CPU in the CPU widget.
|
`-p`, `--percpu` Show each CPU in the CPU widget.
|
||||||
`-a`, `--averagecpu` Show average CPU in the CPU widget.
|
`-a`, `--averagecpu` Show average CPU in the CPU widget.
|
||||||
`-f`, `--fahrenheit` Show temperatures in fahrenheit.
|
`-f`, `--fahrenheit` Show temperatures in fahrenheit.
|
||||||
`-s`, `--statusbar` Show a statusbar with the time.
|
`-s`, `--statusbar` Show a statusbar with the time.
|
||||||
`-b`, `--battery` Show battery level widget (`minimal` turns off). [preview](./assets/screenshots/battery.png) (DEPRECATED for `-l battery`)
|
`-b`, `--battery` Show battery level widget (`minimal` turns off). (DEPRECATED, use `-l battery`)
|
||||||
`-i`, `--interface=NAME` Select network interface [default: all].
|
`-i`, `--interface=NAME` Select network interface [default: all].
|
||||||
`-l`, `--layout=NAME` Choose a layout. gotop searches for a file by NAME in \$XDG_CONFIG_HOME/gotop, then relative to the current path. "-" reads a layout from stdin, allowing for simple, one-off layouts such as `echo net | gotop -l -`
|
`-l`, `--layout=NAME` Choose a layout. gotop searches for a file by NAME in \$XDG_CONFIG_HOME/gotop, then relative to the current path. "-" reads a layout from stdin, allowing for simple, one-off layouts such as `echo net | gotop -l -`
|
||||||
|
|
||||||
@ -181,6 +181,15 @@ Several interfaces can be defined using comma separated values.
|
|||||||
|
|
||||||
Interfaces can also be ignored using `!`
|
Interfaces can also be ignored using `!`
|
||||||
|
|
||||||
|
## More screen shots
|
||||||
|
|
||||||
|
#### "-l battery"
|
||||||
|
<img src="./assets/screenshots/battery.png" />
|
||||||
|
#### "-l minimal"
|
||||||
|
<img src="./assets/screenshots/minimal.png" />
|
||||||
|
#### Custom (layouts/procs)
|
||||||
|
<img src="./assets/screenshots/procs.png" />
|
||||||
|
|
||||||
## Built With
|
## Built With
|
||||||
|
|
||||||
- [gizak/termui](https://github.com/gizak/termui)
|
- [gizak/termui](https://github.com/gizak/termui)
|
||||||
|
Before Width: | Height: | Size: 93 KiB After Width: | Height: | Size: 122 KiB |
Before Width: | Height: | Size: 146 KiB After Width: | Height: | Size: 146 KiB |
BIN
assets/screenshots/kitchensink.gif
Normal file
After Width: | Height: | Size: 230 KiB |
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 87 KiB |
BIN
assets/screenshots/procs.png
Normal file
After Width: | Height: | Size: 160 KiB |
29
build/PKGBUILD
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
# Maintainer: Fabio 'Lolix' Loli <lolix@disroot.org> -> https://github.com/FabioLolix
|
||||||
|
# Co-maintainer/contributor: Sean E. Russell <ser@ser1.net>
|
||||||
|
|
||||||
|
pkgname=gotop
|
||||||
|
pkgver=3.3.1
|
||||||
|
pkgrel=0
|
||||||
|
pkgdesc='A terminal based graphical activity monitor inspired by gtop and vtop'
|
||||||
|
arch=(x86_64 i686 arm armv6h armv7h aarch64 armv5h)
|
||||||
|
url="https://github.com/xxxserxxx/gotop"
|
||||||
|
license=(AGPL3)
|
||||||
|
provides=(gotop)
|
||||||
|
conflicts=(gotop)
|
||||||
|
makedepends=("go")
|
||||||
|
depends=('glibc>=2.31-1')
|
||||||
|
source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/v${pkgver}.tar.gz")
|
||||||
|
sha256sums=('79b261e5d778ddfdf85ded375dc4877b7d508916b771c2d1b7655849776ea66c')
|
||||||
|
|
||||||
|
build() {
|
||||||
|
cd "${srcdir}"/${pkgname}-${pkgver}
|
||||||
|
go build \
|
||||||
|
-gcflags "all=-trimpath=${PWD}" \
|
||||||
|
-asmflags "all=-trimpath=${PWD}" \
|
||||||
|
-ldflags "-extldflags ${LDFLAGS}" \
|
||||||
|
./cmd/gotop
|
||||||
|
}
|
||||||
|
|
||||||
|
package() {
|
||||||
|
install -Dm755 "${srcdir}"/${pkgname}-${pkgver}/gotop "${pkgdir}"/usr/bin/gotop
|
||||||
|
}
|
@ -41,6 +41,11 @@ var (
|
|||||||
stderrLogger = log.New(os.Stderr, "", 0)
|
stderrLogger = log.New(os.Stderr, "", 0)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// TODO: state:merge #135 linux console font (cmatsuoka/console-font)
|
||||||
|
// TODO: state:deferred 157 FreeBSD fixes & Nvidia GPU support (kraust/master). Significant CPU use impact for NVidia changes.
|
||||||
|
// TODO: Virtual devices from Prometeus metrics @feature
|
||||||
|
// TODO: Export Prometheus metrics @feature
|
||||||
|
// TODO: state:merge #167 configuration file (jrswab/configFile111)
|
||||||
func parseArgs(conf *gotop.Config) error {
|
func parseArgs(conf *gotop.Config) error {
|
||||||
usage := `
|
usage := `
|
||||||
Usage: gotop [options]
|
Usage: gotop [options]
|
||||||
|
11
config.go
@ -12,16 +12,7 @@ import (
|
|||||||
"github.com/xxxserxxx/gotop/widgets"
|
"github.com/xxxserxxx/gotop/widgets"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TODO: Cross-compiling for darwin, openbsd requiring native procs & temps
|
// TODO: test, build, release [#119] [#120] [#121]
|
||||||
// TODO: Merge #184 or #177 degree symbol (BartWillems:master, fleaz:master)
|
|
||||||
// TODO: Merge #169 % option for network use (jrswab:networkPercentage)
|
|
||||||
// TODO: Merge #167 configuration file (jrswab:configFile111)
|
|
||||||
// TODO: Merge #157 FreeBSD fixes & Nvidia GPU support (kraust:master)
|
|
||||||
// TODO: Merge #156 Added temperatures for NVidia GPUs (azak-azkaran:master)
|
|
||||||
// TODO: Merge #135 linux console font (cmatsuoka:console-font)
|
|
||||||
// TODO: Export Prometheus metrics @feature
|
|
||||||
// TODO: Virtual devices from Prometeus metrics @feature
|
|
||||||
// TODO test, build, release [#119] [#120] [#121]
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
ConfigDir string
|
ConfigDir string
|
||||||
LogDir string
|
LogDir string
|
||||||
|
@ -236,6 +236,7 @@ func countMaxHeight(rs [][]widgetRule) int {
|
|||||||
// deepFindProc looks in the UI widget tree for the ProcWidget,
|
// deepFindProc looks in the UI widget tree for the ProcWidget,
|
||||||
// and returns it if found or nil if not.
|
// and returns it if found or nil if not.
|
||||||
func deepFindProc(gs interface{}) *widgets.ProcWidget {
|
func deepFindProc(gs interface{}) *widgets.ProcWidget {
|
||||||
|
// FIXME: `procs` layout isn't passing down keystrokes
|
||||||
// Recursive function #1. Recursion is OK here because the number
|
// Recursive function #1. Recursion is OK here because the number
|
||||||
// of UI elements, even in a very complex UI, is going to be
|
// of UI elements, even in a very complex UI, is going to be
|
||||||
// relatively small.
|
// relatively small.
|
||||||
|
@ -52,8 +52,25 @@ func (b *BatteryWidget) Scale(i int) {
|
|||||||
func (self *BatteryWidget) update() {
|
func (self *BatteryWidget) update() {
|
||||||
batteries, err := battery.GetAll()
|
batteries, err := battery.GetAll()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("failed to get battery info: %v", err)
|
switch errt := err.(type) {
|
||||||
|
case battery.ErrFatal:
|
||||||
|
log.Printf("fatal error fetching battery info: %v", err)
|
||||||
return
|
return
|
||||||
|
case battery.Errors:
|
||||||
|
batts := make([]*battery.Battery, 0)
|
||||||
|
for i, e := range errt {
|
||||||
|
if e == nil {
|
||||||
|
batts = append(batts, batteries[i])
|
||||||
|
} else {
|
||||||
|
log.Printf("recoverable error fetching battery info; skipping battery: %v", e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if len(batts) < 1 {
|
||||||
|
log.Print("no usable batteries found")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
batteries = batts
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for i, battery := range batteries {
|
for i, battery := range batteries {
|
||||||
id := makeId(i)
|
id := makeId(i)
|
||||||
|
@ -27,6 +27,7 @@ type NetWidget struct {
|
|||||||
NetInterface []string
|
NetInterface []string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: state:merge #169 % option for network use (jrswab/networkPercentage)
|
||||||
func NewNetWidget(netInterface string) *NetWidget {
|
func NewNetWidget(netInterface string) *NetWidget {
|
||||||
recvSparkline := ui.NewSparkline()
|
recvSparkline := ui.NewSparkline()
|
||||||
recvSparkline.Data = []int{}
|
recvSparkline.Data = []int{}
|
||||||
|
@ -29,6 +29,7 @@ type TempWidget struct {
|
|||||||
TempScale TempScale
|
TempScale TempScale
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: state:deferred 156 Added temperatures for NVidia GPUs (azak-azkaran/master). Crashes on non-nvidia machines.
|
||||||
func NewTempWidget(tempScale TempScale) *TempWidget {
|
func NewTempWidget(tempScale TempScale) *TempWidget {
|
||||||
self := &TempWidget{
|
self := &TempWidget{
|
||||||
Block: ui.NewBlock(),
|
Block: ui.NewBlock(),
|
||||||
@ -84,6 +85,7 @@ func (self *TempWidget) Draw(buf *ui.Buffer) {
|
|||||||
image.Pt(self.Inner.Min.X, self.Inner.Min.Y+y),
|
image.Pt(self.Inner.Min.X, self.Inner.Min.Y+y),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// TODO: state:merge #184 or #177 degree symbol (BartWillems/master, fleaz/master)
|
||||||
switch self.TempScale {
|
switch self.TempScale {
|
||||||
case Fahrenheit:
|
case Fahrenheit:
|
||||||
buf.SetString(
|
buf.SetString(
|
||||||
|