Another terminal based graphical activity monitor, inspired by [gtop](https://github.com/aksakalli/gtop) and [vtop](https://github.com/MrRio/vtop), this time written in [Go](https://golang.org/)!
Join us in [\#gotop:matrix.org](https://riot.im/app/#/room/#gotop:matrix.org) ([matrix clients](https://matrix.to/#/#gotop:matrix.org)).
![](https://github.com/xxxserxxx/gotop/workflows/Build%20Go%20binaries/badge.svg)
![](https://github.com/xxxserxxx/gotop/workflows/Create%20pre-release/badge.svg)
![](https://raw.githubusercontent.com/xxxserxxx/gotop/master/docs/release.svg)
See the [mini-blog](https://github.com/xxxserxxx/gotop/wiki/Micro-Blog) for updates on the build status, and the [change log](/CHANGELOG.md) for release updates.
## 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.
- **Arch**: Install from AUR, e.g. `yay -S gotop-bin`. There is also `gotop` and `gotop-git`
- **Gentoo**: gotop is available on [guru](https://gitweb.gentoo.org/repo/proj/guru.git) overlay.
```shell
sudo layman -a guru
sudo emerge gotop
```
- **OSX**: gotop is in *homebrew-core*. `brew install gotop`. Make sure to uninstall and untap any previous installations or taps.
- **Prebuilt binaries**: Binaries for most systems can be downloaded from [the github releases page](https://github.com/xxxserxxx/gotop/releases). RPM and DEB packages are also provided.
- **Source**: This requires Go >= 1.14. `go get -u github.com/xxxserxxx/gotop/cmd/gotop`
### Console Users Note
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:
```shell
$ curl -O -L https://raw.githubusercontent.com/xxxserxxx/gotop/master/fonts/Lat15-VGA16-braille.psf
$ setfont Lat15-VGA16-braille.psf
```
### Building
This is the download & compile approach.
gotop should build with most versions of Go. If you have a version other than 1.14 installed, remove the `go` line at the end of `go.mod`.
```
git clone https://github.com/xxxserxxx/gotop.git
cd gotop
sed -i '/^go/d' go.mod # Do this if you have go != 1.14
go build -o gotop ./cmd/gotop
```
Move `gotop` 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`.
## 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:
- click to select process
- mouse wheel to scroll through processes
## Config file
Most command-line settings can be persisted into a configuration file. The config file is named `gotop.conf` and can be located in several places. The first place gotop will look is in the current directory; after this, the locations depend on the OS and distribution. On Linux using XDG, for instance, the home location of `~/.config/gotop/gotop.conf` is the second location. The last location is a system-wide global location, such as `/etc/gotop/gotop.conf`. The `-h` help command will print out all of the locations, in order. Command-line options override values in any config files, and only the first config file found is loaded.
A configuration file can be created using the `--write-config` command-line argument. This will try to place the config file in the home config directory (the second location), but if it's unable to do so it'll write a file to the current directory.
Config file changes can be made by combining command-line arguments with `--write-config`. For example, to persist the `solarized` theme, call:
```
gotop -c solarized --write-config
```
### Colorschemes
gotop ships with a few colorschemes which can be set with the `-c` flag followed by the name of one. You can find all the colorschemes in the [colorschemes folder](./colorschemes).
To make a custom colorscheme, check out the [template](./colorschemes/template.go) for instructions and then use [default.json](./colorschemes/default.json) as a starter. Then put the file at `~/.config/gotop/