Home

Awesome

<div align="center"> <img src="./assets/logo/logo.png" width="20%" />

</div> <br><br>

Another terminal based graphical activity monitor, inspired by gtop and vtop, this time written in Go!

Join us in #gotop:matrix.org (matrix clients).

Badges? We don't need no stinking badges!

<div align="center">

</div>

See the change log for release updates.

<img src="./assets/screenshots/demo.gif" /> </div>

Installation

Working and tested on Linux, FreeBSD and MacOS. Windows binaries are provided, but have limited testing. OpenBSD works with some caveats; cross-compiling is difficult and binaries are not provided.

If you install gotop by hand, or you download or create new layouts or colorschemes, you will need to put the layout files where gotop can find them. To see the list of directories gotop looks for files, run gotop -h. The first directory is always the directory from which gotop is run.

Extensions update

Extensions have proven problematic; go plugins are not usable in real-world cases, and the solution I had running for a while was hacky, at best. Consequently, extensions have been moved into the main code base for now.

Console Users

gotop requires a font that has braille and block character Unicode code points; some distributions do not provide this. In the gotop repository is a pcf font that has these points, and setting this font may improve how gotop renders in your console. To use this, run these commands:

curl -O -L https://raw.githubusercontent.com/xxxserxxx/gotop/master/fonts/Lat15-VGA16-braille.psf
setfont Lat15-VGA16-braille.psf

Platform-specific features

Sometimes libraries that gotop uses to introspect the hardware only support a subset of operating systems. Rather than cripple gotop to the LCD, I'm allowing features that may only work on some platforms. These will be listed here:

Building

This is the download & compile approach.

gotop requires Go 1.16 or later to build, as it relies on the embed feature released with 1.16; a library it uses, lingo, uses both embed and the io/fs package. For a version of gotop that builds with earlier versions, check out one of the tags prior to v4.2.0.

git clone https://github.com/xxxserxxx/gotop.git
cd gotop
# This ugly SOB gets a usable version from the git tag list
VERS="$(git tag -l --sort=-v:refname | sed 's/v\([^-].*\)/\1/g' | head -1 | tr -d '-' ).$(git describe --long --tags | sed 's/\([^-].*\)-\([0-9]*\)-\(g.*\)/r\2.\3/g' | tr -d '-')"
DAT=$(date +%Y%m%dT%H%M%S)
go build -o gotop \
	-ldflags "-X main.Version=v${VERS} -X main.BuildDate=${DAT}" \
	./cmd/gotop

If you want to compact the executable as much as possible on Linux, change the ldflags line to this:

-ldflags "-X main.Version=v${VERS} -X main.BuildDate=${DAT} -extldflags '-s -w'" \

Now move the gotop executable to somewhere in your $PATH.

If Go is not installed or is the wrong version, and you don't have root access or don't want to upgrade Go, a script is provided to download Go and the gotop sources, compile gotop, and then clean up. See scripts/install_without_root.sh.

go generate

With Go 1.16, it is no longer necessary to call go generate. Translations and Apple SMC tags are embedded with go:embed.

Usage

Run with -h to get an extensive list of command line arguments. Many of these can be configured by creating a configuration file; see the next section for more information. Key bindings can be viewed while gotop is running by pressing the ? key, or they can be printed out by using the --list keys command.

In addition to the key bindings, the mouse can be used to control the process list:

For more information on other topics, see:

Monitoring remote machines

gotop can monitor gotops running on remote machines and display (some of the) metrics within a single instance. gotop expects to be behind a proxy, or within a secure intranet, so while it's not exactly hard to set up, it's also not trivial. An example set-up is explained in the Remote Monitoring document.

More screen shots

'-l kitchensink' + colorscheme

<img src="./assets/screenshots/kitchensink.gif" />

"-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" />

Contributors

Many people have contributed code to gotop. Most of the work was by the original author, Caleb Bassi, who was seduced by the dark side (Rust) and had to be thrown into a volcano. Thanks to everyone who's submitted a PR, or otherwise contributed to the project!

Built With

History

ca. 2020-01-25 The original author of gotop started a new tool in Rust, called ytop, and deprecated his Go version. This repository is a fork of original gotop project with a new maintainer to keep the project alive and growing. An objective of the fork is to maintain a small, focused core while providing a path to extend functionality for less universal use cases; examples of this is sensor support for NVidia graphics cards, and for aggregating data from remote gotop instances.

Alternatives

I obviously think gotop is the Bee's Knees, but there are many alternatives. Many of these have been around for years. All of them are terminal-based tools.

A comment on clones

In a chat room I heard someone refer to gotop as "another one of those fancy language rewrites people do." I'm not the original author of gotop, so it's easy to not take offense, but I'm going on record as saying that I disagree with that sentiment: I think these rewrites are valuable, useful, and healthy to the community. They increase software diversity at very little cost to users, and are a sort of evolutionary mechanism: as people do rewrites, some are worse, but some are better, and users benefit. Rewrites provide options, which fight against monocultures. As importantly, most developers are really only fluent in a couple of programming languages. We all have familiarity with a dozen, and may even have extensive experience with a half-dozen, but if you don't constantly use a language, you tend to forget the extended library APIs, your development environment isn't tuned, you're rusty with using the tool sets, and you may have forgotten a lot of the language peculiarities and gotchas. The barrier to entry for contributing to a software project -- to simply finding and fixing a bug -- in a language you're not intimate with can be very high. It gets much worse if the project owner is a stickler for a particular style. So I believe that gotop's original author's decision to rewrite his project in Rust is a net positive. He probably made fewer design mistakes in ytop (we always do, on the second rewrite), and Rust developers -- who may have hesitated learning or brushing up on Go to submit an improvement -- have another project to which they can contribute.

Diversity is good. Don't knock the free stuff.

Star History

Star History Chart