Convert Figma logo to code with AI

xxxserxxx logogotop

A terminal based graphical activity monitor inspired by gtop and vtop

2,744
138
2,744
83

Top Related Projects

7,357

A terminal based graphical activity monitor inspired by gtop and vtop

19,111

A monitor of resources

26,263

Glances an Eye on your system. A top/htop alternative for GNU/Linux, BSD, Mac OS and Windows operating systems.

6,293

htop - an interactive process viewer

4,055

Terminal-based CPU stress and monitoring utility

9,759

Yet another cross-platform graphical process/system monitor.

Quick Overview

gotop is a terminal-based graphical activity monitor, similar to the popular top command, but with a more visually appealing and interactive interface. It provides real-time monitoring of system resources, including CPU, memory, disk, and network usage, as well as process information.

Pros

  • Intuitive and Visually Appealing Interface: gotop offers a clean and modern interface that makes it easy to quickly understand and interpret system performance data.
  • Cross-Platform Compatibility: gotop is available for multiple operating systems, including Linux, macOS, and Windows, making it a versatile tool.
  • Interactive Features: gotop allows users to interact with the displayed information, such as sorting and filtering processes, and even terminating processes directly from the interface.
  • Customizable Appearance: gotop provides various themes and color schemes, allowing users to personalize the look and feel of the tool.

Cons

  • Limited Functionality Compared to top: While gotop offers a more visually appealing interface, it may lack some of the advanced features and customization options available in the traditional top command.
  • Potential Performance Impact: As a graphical tool, gotop may have a slightly higher resource footprint compared to the command-line top utility, which could be a concern on systems with limited resources.
  • Lack of Advanced Monitoring Features: gotop is primarily focused on providing a visual representation of system resources, and may not offer the same level of detailed monitoring and analysis capabilities as some other system monitoring tools.
  • Dependency on Go Runtime: Since gotop is written in Go, it requires the Go runtime to be installed on the target system, which could be a consideration for some users.

Getting Started

To get started with gotop, follow these steps:

  1. Install the gotop binary for your operating system from the GitHub releases page.
  2. Extract the downloaded archive and move the gotop binary to a directory in your system's PATH.
  3. Open a terminal and run the gotop command to launch the application.

Once gotop is running, you can use the following keyboard shortcuts to interact with the tool:

  • h: Show the help menu
  • q: Quit the application
  • s: Sort the process list by a specific metric (e.g., CPU, memory)
  • k: Kill a selected process
  • 1: Toggle between CPU and per-core CPU usage views
  • 2: Toggle between memory usage and swap usage views
  • 3: Toggle between disk I/O and network I/O views

You can also customize the appearance of gotop by editing the configuration file located at ~/.config/gotop/gotop.json.

Competitor Comparisons

7,357

A terminal based graphical activity monitor inspired by gtop and vtop

Pros of cjbassi/gotop

  • Actively maintained with regular updates and bug fixes
  • Supports a wider range of platforms, including Windows, macOS, and various Linux distributions
  • Provides more detailed system information, such as CPU, memory, and network usage

Cons of cjbassi/gotop

  • May have a slightly more complex configuration and setup process compared to xxxserxxx/gotop
  • Some users may prefer the simpler and more minimalist approach of xxxserxxx/gotop
  • May have a slightly higher resource usage due to the additional features and functionality

Code Comparison

Here's a brief comparison of the code for the main() function in both repositories:

xxxserxxx/gotop:

func main() {
    app := cli.NewApp()
    app.Name = "gotop"
    app.Usage = "A terminal based graphical activity monitor inspired by gtop and vtop"
    app.Version = version
    app.Flags = []cli.Flag{
        cli.BoolFlag{
            Name:  "debug",
            Usage: "Enable debug mode",
        },
    }
    app.Action = run
    app.Run(os.Args)
}

cjbassi/gotop:

func main() {
    app := cli.NewApp()
    app.Name = "gotop"
    app.Usage = "A terminal based graphical activity monitor inspired by gtop and vtop"
    app.Version = version
    app.Flags = []cli.Flag{
        cli.BoolFlag{
            Name:  "debug",
            Usage: "Enable debug mode",
        },
        cli.StringFlag{
            Name:  "theme",
            Usage: "Set the theme (default, hacker, monochrome)",
        },
    }
    app.Action = run
    app.Run(os.Args)
}

The main difference between the two is that cjbassi/gotop includes an additional flag for setting the theme, while xxxserxxx/gotop has a more minimal set of flags.

19,111

A monitor of resources

Pros of btop

  • Supports more platforms, including Windows, macOS, and various Linux distributions
  • Provides a more visually appealing and customizable interface with various themes and color schemes
  • Includes additional metrics and information, such as network usage and disk I/O

Cons of btop

  • May have a steeper learning curve compared to Gotop, as it offers more advanced features and customization options
  • May have a higher resource footprint, especially on older or less powerful systems
  • Requires more configuration to achieve the desired look and feel

Code Comparison

Gotop:

func (t *Tui) Draw() {
    t.Mutex.Lock()
    defer t.Mutex.Unlock()

    t.Ui.Clear()
    t.Ui.Render(t.Widgets...)
}

btop:

void Btop::draw() {
    clear();
    for (auto& widget : widgets) {
        widget->draw();
    }
    refresh();
}
26,263

Glances an Eye on your system. A top/htop alternative for GNU/Linux, BSD, Mac OS and Windows operating systems.

Pros of Glances

  • Glances provides a more comprehensive system monitoring solution, with support for a wide range of metrics and system information.
  • Glances has a more user-friendly and intuitive interface, making it easier for non-technical users to understand and interpret the system data.
  • Glances offers more advanced features, such as the ability to monitor remote systems and generate reports.

Cons of Glances

  • Glances has a larger footprint and may consume more system resources compared to Gotop.
  • Glances may have a steeper learning curve for users who are more comfortable with command-line tools.
  • Glances may not be as lightweight and responsive as Gotop, especially on older or less powerful systems.

Code Comparison

Gotop:

func main() {
    app := gotop.New()
    app.Run()
}

Glances:

def main():
    glances = GlancesClient()
    glances.serve_forever()
6,293

htop - an interactive process viewer

Pros of htop

  • Widely adopted and well-established system monitoring tool
  • Provides a more comprehensive view of system processes and resource utilization
  • Supports a wide range of platforms, including Linux, macOS, and BSD

Cons of htop

  • Requires installation and setup, which may be less convenient for some users
  • May have a steeper learning curve compared to simpler tools like Gotop
  • May have a larger memory footprint and resource requirements

Code Comparison

Gotop:

func (t *Termbox) Render() {
    t.Lock()
    defer t.Unlock()

    t.Clear()
    t.RenderHeader()
    t.RenderProcesses()
    t.RenderFooter()
    t.Flush()
}

htop:

void RichString_appendAscii(RichString* this, const char* str) {
    int len = strlen(str);
    if (this->chlen + len >= this->chsize) {
        this->chsize = this->chsize * 2 + len;
        this->chstr = xRealloc(this->chstr, this->chsize * sizeof(char));
    }
    memcpy(this->chstr + this->chlen, str, len);
    this->chlen += len;
}
4,055

Terminal-based CPU stress and monitoring utility

Pros of s-tui

  • s-tui provides a more visually appealing and customizable interface compared to Gotop.
  • s-tui supports a wider range of metrics, including CPU temperature, fan speed, and GPU usage.
  • s-tui offers the ability to save and load custom configurations, allowing users to personalize their monitoring experience.

Cons of s-tui

  • Gotop has a smaller codebase and may be more lightweight and efficient for some use cases.
  • Gotop supports a wider range of platforms, including Windows, while s-tui is primarily focused on Linux.
  • Gotop may have better performance on older or less powerful systems due to its smaller footprint.

Code Comparison

Gotop:

func (t *Tui) Draw() {
    t.grid.Clear()
    t.grid.SetRect(0, 0, t.width, t.height)

    t.drawHeader()
    t.drawCPU()
    t.drawMemory()
    t.drawNetwork()
    t.drawDisk()
    t.drawProcesses()
}

s-tui:

def update_widgets(self):
    self.cpu_widget.update()
    self.mem_widget.update()
    self.fan_widget.update()
    self.temp_widget.update()
    self.freq_widget.update()
    self.gpu_widget.update()
    self.net_widget.update()
    self.disk_widget.update()
    self.process_widget.update()
9,759

Yet another cross-platform graphical process/system monitor.

Pros of Bottom

  • Bottom provides a more visually appealing and customizable interface compared to Gotop, with support for themes and custom colors.
  • Bottom offers a wider range of metrics and information, including network usage, disk I/O, and process-level details.
  • Bottom has a more intuitive and user-friendly navigation system, making it easier to explore and interact with the system information.

Cons of Bottom

  • Bottom may have a higher resource footprint compared to Gotop, as it provides a more feature-rich and visually complex interface.
  • The installation and configuration process for Bottom may be more involved, especially for users who prefer a simpler setup.
  • Bottom may not be as widely adopted or have the same level of community support as Gotop.

Code Comparison

Gotop:

func main() {
    app := tview.NewApplication()
    grid := tview.NewGrid().
        SetRows(1, 0, 1).
        SetColumns(0, 50, 0)
    grid.AddItem(newHeader(), 0, 1, 1, 1, 0, 0, false)
    grid.AddItem(newBody(), 1, 1, 1, 1, 0, 0, true)
    grid.AddItem(newFooter(), 2, 1, 1, 1, 0, 0, false)
    if err := app.SetRoot(grid, true).Run(); err != nil {
        panic(err)
    }
}

Bottom:

fn main() {
    let app = App::new()
        .with_blocks(blocks)
        .with_theme(theme)
        .with_startup_commands(startup_commands)
        .with_exit_key(Key::Char('q'))
        .run();
    if let Err(err) = app {
        eprintln!("Application error: {}", err);
    }
}

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README



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!

See the change log 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 overlay.
    sudo layman -a guru
    sudo emerge gotop
    
  • Nix: you can run gotop with nix-shell -p gotop --run gotop or add the package gotop to your environment
  • OSX: gotop is in homebrew-core. brew install gotop. Make sure to uninstall and untap any previous installations or taps.
  • Windows: gotop is in the Main bucket. scoop install gotop.
  • Prebuilt binaries: Binaries for most systems can be downloaded from the github releases page. RPM and DEB packages are also provided.
  • Source: This requires Go >= 1.16. go install github.com/xxxserxxx/gotop/v4/cmd/gotop@latest

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.

  • nvidia support: use the --nvidia flag to enable. You must have the nvidia-smi package installed, and gotop must be able to find the nvidia-smi executable, for this to work.
  • remote: allows gotop to pull sensor data from applications exporting Prometheus metrics, including remote gotop instances themselves.

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:

  • nvidia -- only available on systems with an nvidia GPU
  • SMART NVME hard drive temperatures -- Linux & Darwin

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:

  • click to select process
  • mouse wheel to scroll through processes

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

"-l battery"

"-l minimal"

Custom (layouts/procs)

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.

  • Grandpa top. Written 36 years ago, C, installed by default on almost every Unix descendant.
  • bashtop, in pure bash! Beautiful and space efficient, and deserves special comment.
  • bpytop, @aristocratos, the author of bashtop, rewrote it in Python in mid-2020; it's the same beautiful interface, and a very nice alternative.
  • htop. A prettier top. Similar functionality. 16 years old!
  • atop. Detailed process-focused inspection with a table-like view. Been around for 9 long years.
  • iftop, a top for network connections. More than just data transfer, iftop will show what interfaces are connecting to what IP addresses. Requires root access to run.
  • iotop, top for disk access. Tells you which processes are writing to and from disk space, and how much. Also requires root access to run.
  • nmon a dashboard style top; widgets can be dynamically enabled and disabled, pure ASCII rendering, so it doesn't rely on fancy character sets to draw bars.
  • ytop, a rewrite of gotop (ca. 3.0) in Rust. Same great UI, different programming language.
  • slabtop, part of procps-ng, looks like top but provides kernel slab cache information! Requires root.
  • systemd-cgtop, comes with systemd (odds are your system uses systemd, so this is already installed), provides a resource use view of control groups -- basically, which services are using what resources. Does not require root to run.
  • virt-top top for virtualized containers (VMs, like QEMU).
  • ctop top for containers (LXC, like docker)

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