A terminal based graphical activity monitor inspired by gtop and vtop

NO LONGER MAINTAINED. A maintained fork of gotop exists at https://github.com/xxxserxxx/gotop.



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

Installation

Working and tested on Linux, FreeBSD and macOS. Windows support is planned. OpenBSD works with some caveats.

Source

go get github.com/cjbassi/gotop

Prebuilt binaries

Note: Doesn't require Go.

Clone the repo and then run scripts/download.sh to download the correct binary for your system from the releases tab:

git clone --depth 1 https://github.com/cjbassi/gotop /tmp/gotop
/tmp/gotop/scripts/download.sh

Then move gotop into your $PATH somewhere.

Arch Linux

Install gotop, gotop-bin, or gotop-git from the AUR.

FreeBSD

pkg install gotop

Homebrew

brew tap cjbassi/gotop
brew install gotop

Snap

snap install gotop-cjbassi

Note: You may need to enable certain permissions for all of the widgets to work:

snap connect gotop-cjbassi:hardware-observe
snap connect gotop-cjbassi:mount-observe
snap connect gotop-cjbassi:system-observe

Usage

Keybinds

  • Quit: q or <C-c>
  • Process navigation
    • k and <Up>: up
    • j and <Down: down
    • <C-u>: half page up
    • <C-d>: half page down
    • <C-b>: full page up
    • <C-f>: full page down
    • gg and <Home>: jump to top
    • G and <End>: jump to bottom
  • Process actions:
    • <Tab>: toggle process grouping
    • dd: kill selected process or group of processes
  • Process sorting
    • c: CPU
    • m: Mem
    • p: PID
  • CPU and Mem graph scaling:
    • h: scale in
    • l: scale out
  • ?: toggles keybind help menu

Mouse

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

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.

To make a custom colorscheme, check out the template for instructions and then use default.json as a starter. Then put the file at ~/.config/gotop/<name>.json and load it with gotop -c <name>. Colorschemes PR's are welcome!

CLI Options

-c, --color=NAME Set a colorscheme.
-m, --minimal Only show CPU, Mem and Process widgets.
-r, --rate=RATE Number of times per second to update CPU and Mem widgets [default: 1].
-V, --version Print version and exit.
-p, --percpu Show each CPU in the CPU widget.
-a, --averagecpu Show average CPU in the CPU widget.
-s, --statusbar Show a statusbar with the time.
-b, --battery Show battery level widget (minimal turns off). preview -i, --interface=NAME Select network interface [default: all].

Built With

Stargazers over time

Stargazers over time

Owner
Caleb Bassi
Matrix: @cjbassi:matrix.org
Caleb Bassi
Comments
  • Panic on Mac caused by cpu percentages issue

    Panic on Mac caused by cpu percentages issue

    panic: runtime error: index out of range
    
    goroutine 6 [running]:
    github.com/cjbassi/gotop/widgets.(*CPU).update(0xc42000afc0)
    	/home/cjbassi/go/src/github.com/cjbassi/gotop/widgets/cpu.go:52 +0x3c9
    created by github.com/cjbassi/gotop/widgets.NewCPU
    	/home/cjbassi/go/src/github.com/cjbassi/gotop/widgets/cpu.go:35 +0x2cc
    
  • Adding OSX support

    Adding OSX support

    Need to fix the following issues caused by gopsutil on OSX:

    • [x] temperatures widget doesn't work
    • [x] CPU percentages only work when building from source (cross compiling doesn't work)
    • [x] getting process info takes a long time and is CPU intensive

    I don't have a Mac to test on so help is appreciated.

  • Excessive panics/crashes

    Excessive panics/crashes

    This was obviously done on purpose, as the definition of Error() throws a panic at the end. What drove this design decision, rather than gracefully handling the error?

    On both Mac and Linux, I can't run gotop for more than 24 hours because -- whether due to a sleep/resume or some other random condition -- gotop inevitably receives a value it doesn't like, raises an Error, and panics out. On Linux, this appears to happen most with the net widget; maybe when my wireless goes down temporarily? I can't tell. But I'm baffled why you wrote the application to panic when gotop can't interpret a value.

  • macOS: process name is cropped

    macOS: process name is cropped

    See the image:

    screen shot 2018-08-08 at 13 23 42
    • The output of uname -a

    Darwin november 17.6.0 Darwin Kernel Version 17.6.0: Tue May 8 15:22:16 PDT 2018; root:xnu-4570.61.1~1/RELEASE_X86_64 x86_64

    • Terminal shell (like zsh or bash)

    bash

    • Terminal emulator (like iTerm or gnome terminal)

    iTerm

    • Using tmux?

    Nope

  • Slow startup

    Slow startup

    Some people have been having slow startups so I created an issue for it.

    If you feel inclined to provide some debugging info and have the Go toolchain set up, you can:

    go get github.com/cjbassi/gotop
    # move into the repo
    git checkout slow-startup
    go run main.go
    

    gotop should print some numbers. If gotop stays on a number for a while, let me know:

    • which one it is
    • how long it stays there
    • what your OS is
    • whether gotop does eventually display normally

    Thanks!

  • panic: runtime error: invalid memory address or nil pointer dereference

    panic: runtime error: invalid memory address or nil pointer dereference

    Hi dev! So, I just updated my distro and this bug happen with gotop:

    panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x50f86f]

    goroutine 12 [running]: github.com/cjbassi/gotop/src/widgets.(*Disk).update(0xc42000d2c0) /home/cjbassi/go/src/github.com/cjbassi/gotop/src/widgets/disk.go:90 +0x66f github.com/cjbassi/gotop/src/widgets.NewDisk(0x0) /home/cjbassi/go/src/github.com/cjbassi/gotop/src/widgets/disk.go:42 +0x195 main.initWidgets.func5() /home/cjbassi/go/src/github.com/cjbassi/gotop/main.go:214 +0x22 created by main.initWidgets /home/cjbassi/go/src/github.com/cjbassi/gotop/main.go:213 +0xda

    Looks like its the same bug that happen with this guy: https://github.com/cjbassi/gotop/issues/39 Heres my distro info: Linux 4.14.52-1-MANJARO #1 SMP PREEMPT Tue Jun 26 15:24:31 UTC 2018 x86_64 GNU/Linux Shell: bash Terminal: urxvt I have tmux but im not using it to see gotop. gotop version 1.4.0.

    Do I need to change the gotop code or inform manjaro devs?

  • EPYC/ZEN CPUs not supported ?

    EPYC/ZEN CPUs not supported ?

    Hello,

    I'm testing gotop 1.3.0 ( gotop_1.3.0_linux_amd64.tgz ) I noticed on my EPYC Server it won't show any CPU in
    the CPU widgets while is fine on my Intel boxes.

    The box has 2 * 16C/32T CPUs installed.

    getconf _NPROCESSORS_ONLN
    64
    
    

    epyc_64c_box

    • The output of uname -a
    Linux ant 4.16.11-fw1 #1 SMP PREEMPT Tue May 22 21:17:26 CEST 2018 x86_64 AMD EPYC 7281 16-Core Processor AuthenticAMD GNU/Linux
    
    
    • Terminal shell (like zsh or bash)
    $ echo $SHELL
    /bin/bash
    
    
    • Terminal emulator (like iTerm or gnome terminal)
    konsole -> ssh -> server ( cli )
    
    
    • Using tmux?
    No
    

    Also k10temp is wrong on ZEN .. Each CPU has 4 dies and each die a temp meaning on 2 soket box we get 8 different temperatures not just one.

    eg this:

    k10temp-pci-00e3
    Adapter: PCI adapter
    temp1:        +20.5°C  (high = +70.0°C)
    
    k10temp-pci-00d3
    Adapter: PCI adapter
    temp1:        +20.8°C  (high = +70.0°C)
    
    k10temp-pci-00c3
    Adapter: PCI adapter
    temp1:        +23.5°C  (high = +70.0°C)
    
    k10temp-pci-00fb
    Adapter: PCI adapter
    temp1:        +19.8°C  (high = +70.0°C)
    
    k10temp-pci-00eb
    Adapter: PCI adapter
    temp1:        +20.5°C  (high = +70.0°C)
    
    k10temp-pci-00db
    Adapter: PCI adapter
    temp1:        +20.2°C  (high = +70.0°C)
    
    k10temp-pci-00cb
    Adapter: PCI adapter
    temp1:        +20.1°C  (high = +70.0°C)
    
    k10temp-pci-00f3
    Adapter: PCI adapter
    temp1:        +19.0°C  (high = +70.0°C)
    
    

    If you need more infos please let me know.

    Regards

  • Panic: Issue with CPU percentages

    Panic: Issue with CPU percentages

    Data: Gotop version: 1.2.11 MacOS 10.12.6 Darwin Kernel Version 16.7.0: Tue Jan 30 11:27:06 PST 2018; root:xnu-3789.73.11~1/RELEASE_X86_64 x86_64

    Shell is bash

    Terminal is iTerm

    Not using tmux

    Error:

    Error caught. Exiting program.
    
    Issue with CPU percentages.
    
    Diagnostics:
    self.Count: 8
    gopsutil.Counts(): 8
    len(percents): 0
    percents: []
    self.interval: 1s
    
    panic: 1
    
    goroutine 15 [running]:
    github.com/cjbassi/gotop/utils.Error(0x11841d7, 0xf, 0xc42001e4e0, 0x52)
    	/home/cjbassi/go/src/github.com/cjbassi/gotop/utils/utils.go:30 +0x23f
    github.com/cjbassi/gotop/widgets.(*CPU).update(0xc42000b020)
    	/home/cjbassi/go/src/github.com/cjbassi/gotop/widgets/cpu.go:57 +0x532
    created by github.com/cjbassi/gotop/widgets.NewCPU
    	/home/cjbassi/go/src/github.com/cjbassi/gotop/widgets/cpu.go:38 +0x2d3
    
  • The custom colorschemes simply doesn't work

    The custom colorschemes simply doesn't work

    Required information:

    • gotop version: 1.7.1
    • The output of uname -a: Linux motherbase 4.20.1-arch1-1-ARCH #1 SMP PREEMPT Wed Jan 9 20:25:43 UTC 2019 x86_64 GNU/Linux
    • Terminal shell (e.g. zsh or bash): Bash
    • Terminal emulator (e.g. iTerm or gnome terminal): urxvt and Termine

    The custom colorscheme doesnt work. I use the default.json as a base and save a file .json on .config/gotop and ok, if i run gotop -c name.json it opens gotop, but then it doesnt matter if i edit the values, ANYTHING i change on the numbers on fg, bars or anything it simply does no effect, it remains the same, the same colors as if i just type gotop on the terminal

  • Addition of a Clock Widget?

    Addition of a Clock Widget?

    I really like GoTop - I usually have it full screen on one of my monitors.

    Would there be any way there could be a built-in clock widget to display time as my task bar is taken up by the GoTop terminal I have in maximum size?

    Thanks!

  • Crash due to SIGSEGV in Disk widget update due to ignored error return

    Crash due to SIGSEGV in Disk widget update due to ignored error return

    Stack trace:

    panic: runtime error: invalid memory address or nil pointer dereference
    [signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x52108c]
    
    goroutine 24 [running]:
    github.com/cjbassi/gotop/src/widgets.(*Disk).update(0xc000244000)
    	/build/go/src/github.com/cjbassi/gotop/src/widgets/disk.go:90 +0x60c
    github.com/cjbassi/gotop/src/widgets.NewDisk(0x0)
    	/build/go/src/github.com/cjbassi/gotop/src/widgets/disk.go:42 +0x177
    main.initWidgets.func5()
    	/build/go/src/github.com/cjbassi/gotop/main.go:252 +0x22
    created by main.initWidgets
    	/build/go/src/github.com/cjbassi/gotop/main.go:251 +0xdb
    

    Analysis:

    The return value of psDisk.Usage(Part.Mount) (disk.go:89) may include an error value. This value is ignored, and nil is returned as usage, which is immediately dereferenced.

    With some printf debugging:

    Testing usage of /var/lib/docker
    usage={"path":"/var/lib/docker","fstype":"zfs","total":137729015808, [...]
    err=<nil>
    
    Testing usage of /var/lib/docker/zfs/graph/ff22819000f48b6f19cb17f41c389840cb3f0feb44de3aaffc6af0569ec7246f
    usage=<nil>
    err=permission denied
    panic: runtime error: invalid memory address or nil pointer dereference
    [signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x52141c]
    

    Please give the following info:

    • The output of uname -a: Linux altenberg 4.14.74 #1-NixOS SMP Thu Oct 4 00:01:00 UTC 2018 x86_64 GNU/Linux
    • Any relevenat hardware info: regular desktop system
    • Terminal shell (like zsh or bash): zsh
    • Terminal emulator (like iTerm or gnome terminal): iTerm
    • tmux version if using tmux: n/a
  • Temperature and CPU values on Raspberry Pi 4

    Temperature and CPU values on Raspberry Pi 4

    • gotop version (gotop -V): gotop v4.0.0 (20200607T220652)
    • The output of uname -a: Linux UD-TinyPiNAS 4.19.127-1-MANJARO-ARM #1 SMP PREEMPT Thu Jun 11 06:12:53 CDT 2020 aarch64 GNU/Linux
    • Terminal emulator (e.g. iTerm or gnome terminal): Kitty
    • Any relevenat hardware info: Raspberry Pi 4 1 GB RAM
    • Additional notes: gotop was installed from the AUR package gotop-bin using yay The RPI 4 is on my local network and being SSH'd onto
    • Screenshot of gotop: image

    What happens is, although the RPI 4 has the function to measure the CPU temperature by running /opt/vc/bin/vcgencmd measure_temp nothing is shown. Also in the CPU field all of the processes show either NaN or +inf.

    The temperature issue is already reported at issue #37. The CPU issue might be due to the architecture of the system because issue #104 shows that somebody using arch on a armv7 raspberry pi outputs CPU values different than NaN and inf, although claiming to be inconsistent with htop.

  • Fonts needed in gotop?

    Fonts needed in gotop?

    This is more of a question rather than an issue, but I could not find any answers on my own. The question is, what fonts does gotop require to show the graphs properly? I am on Arch and have installed a couple of font packages like noto-fonts and the ones that come with firefox but my gotop instance currently looks like this:

    gotop

    On Ubuntu the graphs are fine but I can't seem to figure out which font gotop needs in order to install it on Arch.

  • cannot execute binary file: Exec format error

    cannot execute binary file: Exec format error

    I have installed this program from sudo snap install gotop-brlin and when i exectute gotop this message show up bash: /usr/local/bin/gotop: cannot execute binary file: Exec format error

  • Missing temperature

    Missing temperature

    Required information:

    • gotop version (gotop -V): 3.5.1
    • The output of uname -a: Linux plasma 5.4.40-1-MANJARO #1 SMP PREEMPT Sun May 10 14:17:40 UTC 2020 x86_64 GNU/Linux
    • Terminal emulator (e.g. iTerm or gnome terminal): Konsole
    • Any relevenat hardware info:
    $ nvidia-smi
    Tue May 19 21:04:50 2020       
    +-----------------------------------------------------------------------------+
    | NVIDIA-SMI 440.82       Driver Version: 440.82       CUDA Version: 10.2     |
    |-------------------------------+----------------------+----------------------+
    | GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
    | Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
    |===============================+======================+======================|
    |   0  GeForce GTX 680     Off  | 00000000:01:00.0 N/A |                  N/A |
    | 32%   47C    P8    N/A /  N/A |    531MiB /  4034MiB |     N/A      Default |
    +-------------------------------+----------------------+----------------------+
                                                                                   
    +-----------------------------------------------------------------------------+
    | Processes:                                                       GPU Memory |
    |  GPU       PID   Type   Process name                             Usage      |
    |=============================================================================|
    |    0                    Not Supported                                       |
    +-----------------------------------------------------------------------------+
    
    
    
    $ nvidia-settings -q gpucoretemp
    
      Attribute 'GPUCoreTemp' (plasma:0.0): 47.
        'GPUCoreTemp' is an integer attribute.
        'GPUCoreTemp' is a read-only attribute.
        'GPUCoreTemp' can use the following target types: X Screen, GPU.
      Attribute 'GPUCoreTemp' (plasma:0[gpu:0]): 47.
        'GPUCoreTemp' is an integer attribute.
        'GPUCoreTemp' is a read-only attribute.
        'GPUCoreTemp' can use the following target types: X Screen, GPU.
    
    
    $ nvidia-settings -q gpucoretemp -t
    47
    47
    
    
    $ nvidia-smi --query-gpu=temperature.gpu --format=csv,noheader,nounits
    47
    

    https://wiki.archlinux.org/index.php/NVIDIA/Tips_and_tricks#Displaying_GPU_temperature_in_the_shell

    The nvidia temperature can probably be found in /proc too.

    • tmux version if using tmux: Screen version 4.08.00 (GNU) 05-Feb-20

    Also please copy or attach ~/.local/state/gotop/errors.log if it exists and contains logs: Does not exist

  • Rounding Issue

    Rounding Issue

    I opened gotop just for fun. I formatted /dev/sdd1 (mounted on /mnt/external in the screenshot below) freshly as a 1.8TB big hard drive. In the overview it cleary says it is used 0% and has 1 TB free. I expected it to round up to 2TB instead of down to 1TB.

    Required information:

    • gotop version (gotop -V): 3.5.0
    • The output of uname -a: Linux astolfo 5.6.2-arch1-2 #1 SMP PREEMPT Sun, 05 Apr 2020 05:13:14 +0000 x86_64 GNU/Linux
    • Terminal emulator (e.g. iTerm or gnome terminal): alacritty
    • Any relevenat hardware info: the hard drive in question (sdd1) is 1.8TB of size
    • tmux version if using tmux: -

    image

    Disk /dev/sdd: 1,84 TiB, 2000398934016 bytes, 3907029168 sectors
    Disk model: WDC WD2003FZEX-0
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disklabel type: gpt
    Disk identifier: A2364232-5354-48A4-AF01-303C36AC45D2
    
    Device     Start        End    Sectors  Size Type
    /dev/sdd1   2048 3907028991 3907026944  1,8T Linux filesystem
    
Procmon is a Linux reimagining of the classic Procmon tool from the Sysinternals suite of tools for Windows. Procmon provides a convenient and efficient way for Linux developers to trace the syscall activity on the system.
Procmon is a Linux reimagining of the classic Procmon tool from the Sysinternals suite of tools for Windows. Procmon provides a convenient and efficient way for Linux developers to trace the syscall activity on the system.

Process Monitor for Linux (Preview) Process Monitor (Procmon) is a Linux reimagining of the classic Procmon tool from the Sysinternals suite of tools

Dec 29, 2022
The simple and easy-to-use program designed to watch user activity for Cloud Providers.

Cloud Agent The simple and easy-to-use program is designed to watch user activity and possible orphan clusters for Cloud Providers: Gardener GCP (work

Jun 6, 2022
Simple activity indicator for your command line tools.
Simple activity indicator for your command line tools.

Simple activity indicator for your command line tools.

Oct 22, 2021
Stonks is a terminal based stock visualizer and tracker that displays realtime stocks in graph format in a terminal.
Stonks is a terminal based stock visualizer and tracker that displays realtime stocks in graph format in a terminal.

Stonks is a terminal based stock visualizer and tracker. Installation Requirements: golang >= 1.13 Manual Clone the repo Run make && make install Pack

Dec 16, 2022
Terminal multiplexer inspired by i3

3mux is a terminal multiplexer with out-of-the-box support for search, mouse-controlled scrollback, and i3-like keybindings. Imagine tmux with a small

Dec 28, 2022
Scrappy is a cli tool that allows multiple web scrappers to monitor periodically for a basic ruleset coverage and inform users when the criteria have been met.

Scrappy - A multi-type web scrapper with alerting Scrappy is a cli tool that allows multiple web scrappers to monitor periodically for a basic ruleset

Nov 7, 2021
A goroutine monitor to keep track of active routines from within your favorite shell.
A goroutine monitor to keep track of active routines from within your favorite shell.

roumon A goroutine monitor to keep track of active routines from within your favorite shell. Features Track live state of all active goroutines Termin

Jan 3, 2023
TUI process monitor written in Go
TUI process monitor written in Go

pst This is TUI process monitor written in Go. Features Monitor process's list, info, tree, open files, Kill process Support OS Mac Linux Requirements

Nov 25, 2022
A set of Go scripts to monitor YAGPDB status via the command-line.
A set of Go scripts to monitor YAGPDB status via the command-line.

A set of Go scripts to monitor YAGPDB status by making GET requests to the YAGPDB status endpoint.

Apr 20, 2022
A CLI tool to change monitor settings over USB to the Gigabyte M32U

Gigabyte Monitor control Introduction A CLI tool to change monitor settings over USB to the Gigabyte M32U Supported monitors Gigabyte M32U In theory a

Dec 30, 2022
A modern and intuitive terminal-based text editor
A modern and intuitive terminal-based text editor

micro is a terminal-based text editor that aims to be easy to use and intuitive, while also taking advantage of the capabilities of modern terminals

Jan 7, 2023
Terminal based wordle clone. Uses the amazing charm.sh libraries to render and expose the game over SSH

Terminal based wordle clone. Uses the amazing charm.sh libraries to render and expose the game over SSH

Nov 17, 2022
A tiny command-line orientated PKM tool inspired by Taskwarrior and daily logging.

eden eden is a command line tool for creating and manipulating daily log notes. It started life as a series of different bash script that did various

Jan 20, 2022
A terminal based typing test.
A terminal based typing test.

What A terminal based typing test. Installation Linux sudo curl -L https://github.com/lemnos/tt/releases/download/v0.4.0/tt-linux -o /usr/local/bin/tt

Dec 28, 2022
A collection of terminal-based widgets for richer Golang CLI apps.
A collection of terminal-based widgets for richer Golang CLI apps.

Flinch A collection of terminal-based widgets for richer Golang CLI apps. Ships with a library to build your own widgets/TUIs too. Warning: This modul

Jan 7, 2023
Terminal based dashboard.
Terminal based dashboard.

Termdash is a cross-platform customizable terminal based dashboard. The feature set is inspired by the gizak/termui project, which in turn was inspire

Jan 1, 2023
A terminal based file manager
A terminal based file manager

Keep those files organized About The Project A terminal based file manager Built With Go bubbletea bubbles lipgloss Installation go install github.com

Dec 27, 2022
Terminal based presentation tool
Terminal based presentation tool

Terminal based presentation tool

Jan 2, 2023
TScli - a very simple terminal-based client for TSWeb online judge

TScli TScli - a very simple terminal-based client for TSWeb online judge. It supports submitting problems and receiving feedback on them. Installation

Oct 24, 2021