Another TUI based system monitor, this time in Rust!

Related tags

Command-line ytop
Overview

NO LONGER MAINTAINED. For a similar program, check out https://github.com/ClementTsang/bottom.

ytop

Minimum rustc version Matrix

Another TUI based system monitor, this time in Rust!

Missing features

  • macOS is missing disk io counters and process commandline
  • Process filtering isn't implemented
  • Mouse usage isn't implemented
  • FreeBSD is currently unsupported

Installation

ytop currently works on Linux and macOS with support planned for all major platforms.

Package managers

Packaging status

AUR

ytop is available in three different AUR packages: ytop, ytop-bin, and ytop-git.

COPR

ytop is also available in COPR:

sudo dnf copr enable atim/ytop -y
sudo dnf install ytop

Homebrew

brew tap cjbassi/ytop
brew install ytop

Prebuilt binaries

Prebuilt binaries are provided in the releases tab.

From source

cargo install ytop

Usage

Keybinds

  • Quit: q or
  • Pause:
  • Process navigation:
    • k and : up
    • j and : down
    • : half page up
    • : half page down
    • : full page up
    • : full page down
    • gg and : jump to top
    • G and : jump to bottom
  • Process actions:
    • : toggle process grouping
    • dd: kill selected process or process group
  • Process sorting:
    • p: PID/Count
    • n: Command
    • c: CPU
    • m: Mem
  • Process filtering:
    • /: start editing filter
    • (while editing):
      • : accept filter
      • and : clear filter
  • 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

ytop 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, copy one of the default ones to ~/.config/ytop/.json and load it with ytop -c . Colorscheme PRs are welcome!

CLI Options

USAGE:
    ytop [FLAGS] [OPTIONS]

FLAGS:
    -a, --average-cpu    Show average CPU in the CPU widget
    -b, --battery        Show Battery widget (overridden by 'minimal' flag)
    -f, --fahrenheit     Show temperatures in fahrenheit
    -h, --help           Prints help information
    -m, --minimal        Only show the CPU, Mem, and Process widgets
    -p, --per-cpu        Show each CPU in the CPU widget
    -s, --statusbar      Show a statusbar with the time
    -V, --version        Prints version information

OPTIONS:
    -c, --colorscheme     Set a colorscheme [default: default]
    -i, --interface         The name of the network interface to show in the Net widget. 'all' shows all
                                       interfaces [default: all]
    -I, --interval           Interval in seconds between updates of the CPU and Mem widgets. Can specify
                                       either a whole number or a fraction with a numerator of 1 [default: 1]

Related projects

Comments
  • Crash after running for a while

    Crash after running for a while "overflow when subtracting durations"

    Several times I've had ytop left running and came back to find it crashed with this backtrace:

    Backtrace (most recent call first):
      File "src/libcore/option.rs", line 1185, in core::option::expect_failed
      File "src/libcore/option.rs", line 345, in core::option::Option<T>::expect
      File "src/libcore/time.rs", line 744, in <core::time::Duration as core::ops::arith::Sub>::sub
      File "<unknown>", line 0, in psutil::process::process::Process::cpu_percent
      File "<unknown>", line 0, in <core::iter::adapters::Map<I,F> as core::iter::traits::iterator::Iterator>::try_fold
      File "<unknown>", line 0, in <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T,I>>::from_iter
      File "<unknown>", line 0, in <ytop::widgets::proc::ProcWidget as ytop::update::UpdatableWidget>::update
      File "<unknown>", line 0, in ytop::update::update_widgets
      File "<unknown>", line 0, in ytop::main
      File "<unknown>", line 0, in std::rt::lang_start::{{closure}}
      File "src/libstd/rt.rs", line 48, in std::rt::lang_start_internal::{{closure}}
      File "src/libstd/panicking.rs", line 287, in std::panicking::try::do_call
      File "src/libpanic_unwind/lib.rs", line 78, in __rust_maybe_catch_panic
      File "src/libstd/panicking.rs", line 265, in std::panicking::try
      File "src/libstd/panic.rs", line 396, in std::panic::catch_unwind
      File "src/libstd/rt.rs", line 47, in std::rt::lang_start_internal
      File "<unknown>", line 0, in main
      File "<unknown>", line 0, in __libc_start_main
      File "<unknown>", line 0, in <unknown>
      File "<unknown>", line 0, in <unknown>
    
    The application panicked (crashed).
      overflow when subtracting durations
    in src/libcore/option.rs, line 1185
    thread: main
    
    bug 
    opened by trolley 19
  • macOS support

    macOS support

    Currently rust-psutil is pretty barebones so we need to implement a lot the necessary cross platform functionality. Also, ytop currently only compiles on Linux because only Linux functions are implemented.

    • [x] Refactor rust-psutil to be more modular and allow cross platform functionality: https://github.com/borntyping/rust-psutil/pull/54
    • [x] Implement the functionality on Linux x86
      • [x] temperatures
    • [ ] Implement the functionality on macOS x86
      • [x] cpu percents
      • [x] cpu count
      • [x] memory
      • [ ] temps
      • [ ] disk
      • [x] net
      • [ ] processes
      • [x] battery
    opened by cjbassi 13
  • Fixes missing temperature on mac os

    Fixes missing temperature on mac os

    Hey there,

    I have fixed the missing temperature for mac os by using the same approach as used in the go version of this repo: https://github.com/cjbassi/gotop

    Cheers

    opened by Zarathustra2 12
  • [WIP] Ability to not follow a process

    [WIP] Ability to not follow a process

    This introduces an ability to not-follow a process in the proc widget. I having to do gg whenever I visit ytop to find out the process which is currently using high mem/CPU. It'd be great to have the ability to not always track the currently highlighted process.

    This patch is a POC for that. What it does is:

    • Introduce a new flag on the widget: follow_proc, which is false by default. If it is set to true, the render will always jump to the position for the highlighted position. If it is false, it'll keep the selected position the same, no matter which process lands on it.
    • When ever the user does a scroll action (except gg), ytop will keep track of the process. gg or scroll to top on the other hand, stops the process tracking facilitating a view such as: the current process taking the most resources.
    • Also, bind Esc to set follow_proc as false and disable following of a process.

    I understand this cannot be merged as is, but I'd like to start a discussion. If this makes sense, I'd like suggestions on what can be changed in the patch to merge it in.

    opened by crodjer 8
  • Fix build with tui 0.9

    Fix build with tui 0.9

    Minimal effort changes to make ytop build with tui-0.9.

    Needs some discussion whether proposed approach of Widget ownership/borrowing is fine.

    Fixes #69

    opened by terorie 8
  • Upgrade tui

    Upgrade tui

    We need to upgrade tui for a few features and bug fixes but there is quite a few api changes in the latest release. I've started some work on this in the upgrade-tui branch, but i've just been a little busy with some other things if anybody feels like continuing to work on it. If you make any progress feel free to open a pull request against that branch. Thanks!

    help wanted 
    opened by cjbassi 8
  • With light background unreadable

    With light background unreadable

    image

    Required information:

    • ytop version (ytop -V): ytop 0.5.1
    • The output of uname -a: Linux roman-MS-7B43 5.3.0-40-generic #32-Ubuntu SMP Fri Jan 31 20:24:34 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

    Include any of the following information if relevant:

    • Terminal emulator (e.g. iTerm or gnome terminal): gnome terminal
    • tmux version (tmux -V):
    • Any relevenat hardware info:

    Please copy or attach ~/.local/state/ytop/errors.log if it exists and contains logs:

    opened by rofrol 8
  • attempt to multiply with overflow if swap is disabled

    attempt to multiply with overflow if swap is disabled

    repo @ e56403ded6881bc99a5425dc83d32c94e01f8f85 Linux t470 5.4.12-1-MANJARO #1 SMP PREEMPT Wed Jan 15 08:05:08 UTC 2020 x86_64 GNU/Linux terminal is alacritty

    RUST_BACKTRACE=Full ./target/debug/ytop

    Backtrace (most recent call first):
      File "/home/matthias/.cargo/git/checkouts/tui-rs-7836e4b22d734056/aff0a4c/src/widgets/canvas/mod.rs", line 106, in tui::widgets::canvas::Context::draw
        let index = dy / 4 * self.width as usize + dx / 2;
      File "/home/matthias/.cargo/git/checkouts/tui-rs-7836e4b22d734056/aff0a4c/src/widgets/chart.rs", line 474, in <tui::widgets::chart::Chart<LX,LY> as tui::widgets::Widget>::draw::{{closure}}
        ctx.draw(&Points {
      File "/home/matthias/.cargo/git/checkouts/tui-rs-7836e4b22d734056/aff0a4c/src/widgets/canvas/mod.rs", line 255, in <tui::widgets::canvas::Canvas<F> as tui::widgets::Widget>::draw
        painter(&mut ctx);
      File "/home/matthias/.cargo/git/checkouts/tui-rs-7836e4b22d734056/aff0a4c/src/widgets/chart.rs", line 469, in <tui::widgets::chart::Chart<LX,LY> as tui::widgets::Widget>::draw
        Canvas::default()
      File "src/widgets/mem.rs", line 96, in <ytop::widgets::mem::MemWidget as tui::widgets::Widget>::draw
        Chart::<String, String>::default()
      File "/home/matthias/.cargo/git/checkouts/tui-rs-7836e4b22d734056/aff0a4c/src/terminal.rs", line 49, in tui::terminal::Frame<B>::render
        widget.draw(area, self.terminal.current_buffer_mut());
      File "/home/matthias/.cargo/git/checkouts/tui-rs-7836e4b22d734056/aff0a4c/src/widgets/mod.rs", line 85, in tui::widgets::Widget::render
        f.render(self, area);
      File "src/draw.rs", line 75, in ytop::draw::draw_middle_row
        widgets.mem.render(frame, horizontal_chunks[1]);
      File "src/draw.rs", line 41, in ytop::draw::draw_widgets
        draw_middle_row(frame, widgets, vertical_chunks[1]);
      File "src/draw.rs", line 22, in ytop::draw::draw::{{closure}}
        draw_widgets(&mut frame, &mut app.widgets, chunks[0]);
      File "/home/matthias/.cargo/git/checkouts/tui-rs-7836e4b22d734056/aff0a4c/src/terminal.rs", line 140, in tui::terminal::Terminal<B>::draw
        f(self.get_frame());
      File "src/draw.rs", line 11, in ytop::draw::draw
        terminal.draw(|mut frame| {
      File "src/main.rs", line 128, in ytop::main
        draw(&mut terminal, &mut app).unwrap();
    
    The application panicked (crashed).
      attempt to multiply with overflow
    in /home/matthias/.cargo/git/checkouts/tui-rs-7836e4b22d734056/aff0a4c/src/widgets/canvas/mod.rs, line 106
    thread: main
    
    bug os:linux 
    opened by matthiaskrgr 8
  •  index out of bounds: the len is 0 but the index is 3

    index out of bounds: the len is 0 but the index is 3

    Hello,

    After running ytop for a few hours I get this error below. I've encountered it a few times and I'm unsure how to debug it. Is it possible to run ytop with RUST_BACKTRACE=1 as a flag to find the bug?

    Thanks for your work on this app.

    Cheers.

    Info

    ytop 0.6.2

    Darwin rrfd.local 18.7.0 Darwin Kernel Version 18.7.0: Mon Apr 27 20:09:39 PDT 2020; root:xnu-4903.278.35~1/RELEASE_X86_64 x86_64

    Include any of the following information if relevant:

    ProductName: Mac OS X ProductVersion: 10.14.6 BuildVersion: 18G5033

    alacritty 0.5.0-dev (65bff18) tmux 3.1b

    Please copy or attach ~/.local/state/ytop/errors.log if it exists and contains logs:

    Does not exist

    Error Message:

    Backtrace omitted. Run with RUST_BACKTRACE=1 to display it.
    Run with RUST_BACKTRACE=full to include source snippets.
    
    The application panicked (crashed).
      index out of bounds: the len is 0 but the index is 3
    in rust:src/libcore/slice/mod.rs, line 2842
    thread: main
    
    opened by robertdefilippi 7
  • Vertical gaps in the graph lines

    Vertical gaps in the graph lines

    I noticed that graphs don't look good on my main machine.

    • Here's how it rendered on an old VM (also using Arch and kitty): vm

    • Here's how it renders on my main machine: main

    The dots characters look way too thin. They should look just like on the README screenshot and the VM screenshot.

    kitty.conf:

    font_family                   JetBrainsMonoMedium Nerd Font
    font_size                     10.5
    bold_font                     auto
    italic_font                   auto
    bold_italic_font              auto
    force_ltr                     no
    adjust_line_height            0
    adjust_column_width           0
    disable_ligatures             cursor
    font_features                 none
    box_drawing_scale             0.001, 1, 1.5, 2
    
    

    .Xresources:

    Xft.dpi: 96
    Xft.antialias: true
    Xft.hinting: true
    Xft.rgba: rgb
    Xft.autohint: false
    Xft.hintstyle: hintfull
    Xft.lcdfilter: lcddefault
    

    .xinitrc:

    xrdb -load ~/.config/X11/.Xresources
    

    I tried using another font with kitty (Fira Code Nerd Font Mono) but it doesn't make any difference.

    Any idea which settings I should tweak in order to get the same rendering than the VM one?

    Thanks.

    opened by ghost 6
  • ytop graphics have broken spacing compared to gotop

    ytop graphics have broken spacing compared to gotop

    ytop graphics have a quirk, the points seem to be improperly spaced when the terminal window is maximized.

    Example:

    This is gotop running at the same time:

    Required information:

    • ytop version (ytop -V): ytop v0.4.2 (https://github.com/cjbassi/ytop#f86926c7)
    • The output of uname -a: Linux Dianakko 5.4.17-1-MANJARO #1 SMP PREEMPT Tue Feb 4 11:40:50 UTC 2020 x86_64 GNU/Linux

    Include any of the following information if relevant:

    • Terminal emulator (e.g. iTerm or gnome terminal): Gnome Terminal 3.34.2
    • tmux version (tmux -V): N/A
    • Any relevenat hardware info: N/A

    Please copy or attach ~/.local/state/ytop/errors.log if it exists and contains logs: N/A

    bug 
    opened by amyspark 6
  • Configuration for things displayed

    Configuration for things displayed

    Configuration to show displayed batteries, temperatures, and mount points

    For example, I might want to exclude my CPU die, or include my mouse battery

    opened by Qwerty-Space 0
  • ytop displays negative temperature value

    ytop displays negative temperature value

    Environment

    $ ytop -V
    ytop 0.6.2
    $ uname -a
    Darwin 549725-mitll 19.6.0 Darwin Kernel Version 19.6.0: Sun Jul  5 00:43:10 PDT 2020; root:xnu-6153.141.1~9/RELEASE_X86_64 x86_64
    
    • Software: Mac OS X 10.15.6 (build 19G73), Xcode-11.6, rustc 1.47.0-nightly (cfc572cae 2020-07-30)
    • Any relevenat hardware info: iMac Pro 2019

    ~/.local/state/ytop/errors.log exists, but is empty.

    Problem

    On iMac (but not on older MacBooks) sysinfo provides - and ytop displays - wrong temperature. Note: I cloned sysinfo, and added some sensors (PECI CPU, and a couple more of such) to see what sensors report correctly on both Mac platforms). I found that all of those sensors give correct values on MacBook, but some fail on iMac Pro.

    Screen Shot 2020-08-02 at 21 25 01

    Proposed Workaround

    While we're discussing with @GuillaumeGomez the possibility of fixing sysinfo library - it would be nice if ytop could validate (sanity-check) inputs it receives from it. In this particular case, I'd love if ytop would check the received CPU temperature either against zero, or against CPU Proximity, and if it is lower (i.e., lower than zero, or lower than CPU Proximity) - ignore/drop that value and don't display it.

    Could you do that, please?

    opened by mouse07410 0
  • Document automatic `-a` vs `-p` selection

    Document automatic `-a` vs `-p` selection

    Some people have been rightfully confused (including myself when I first switched to ytop) that some computers will display all CPU cores, vs the average CPU usage. I think it would help if this detection was documented in the --help output next to the -a and -p flags saying something along the lines that it's the default if >= or < 8 cpu cores respectively.

    opened by LovecraftianHorror 0
  • Document minimum supported rust version

    Document minimum supported rust version

    Sadly from what I can tell there's no way to provide information about the minimum supported rust version in Cargo.toml, but there have been a number of issues raised here because of people using outdated compilers and getting build failures (#107 #66 etc.). If a minimum supported rust version was documented in the README and tested against with CI then hopefully people will understand the issue earlier.

    opened by LovecraftianHorror 0
  • run ytop in wsl ubuntu, but doesn`t work

    run ytop in wsl ubuntu, but doesn`t work

    Installed package ytop v0.6.2 (executable ytop) *******> ytop

    Backtrace omitted. Run with RUST_BACKTRACE=1 to display it. Run with RUST_BACKTRACE=full to include source snippets.

    The application panicked (crashed). called Result::unwrap() on an Err value: MissingData { path: "/proc/meminfo", contents: "MemTotal: 16112436 kB\nMemFree: 7029116 kB\nBuffers: 34032 kB\nCached: 188576 kB\nSwapCached: 0 kB\nActive: 167556 kB\nInactive: 157876 kB\nActive(anon): 103104 kB\nInactive(anon): 17440 kB\nActive(file): 64452 kB\nInactive(file): 140436 kB\nUnevictable: 0 kB\nMlocked: 0 kB\nSwapTotal: 13107196 kB\nSwapFree: 12628476 kB\nDirty: 0 kB\nWriteback: 0 kB\nAnonPages: 102824 kB\nMapped: 71404 kB\nShmem: 17720 kB\nSlab: 13868 kB\nSReclaimable: 6744 kB\nSUnreclaim: 7124 kB\nKernelStack: 2848 kB\nPageTables: 2524 kB\nNFS_Unstable: 0 kB\nBounce: 0 kB\nWritebackTmp: 0 kB\nCommitLimit: 515524 kB\nCommitted_AS: 3450064 kB\nVmallocTotal: 122880 kB\nVmallocUsed: 21296 kB\nVmallocChunk: 66044 kB\nHardwareCorrupted: 0 kB\nAnonHugePages: 2048 kB\nHugePages_Total: 0\nHugePages_Free: 0\nHugePages_Rsvd: 0\nHugePages_Surp: 0\nHugepagesize: 2048 kB\nDirectMap4k: 12280 kB\nDirectMap4M: 897024 kB\n" } in /home/ds/.cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-df7c3c540f42cdbd/ytop-0.6.2/src/widgets/mem.rs, line 71 thread: main

    opened by Dongshan-git 7
Releases(0.6.2)
Owner
Caleb Bassi
Matrix: @cjbassi:matrix.org
Caleb Bassi
TUI monitor handler for Hyprland [maintainer=@Degra02]

MonitorMaestro Tired of fiddling with Hyprland configs? Monitor Maestro lets you switch between monitor layouts in a snap! This Rust-powered TUI app l

Hyprland Community 11 Jun 27, 2024
A template for bootstrapping a Rust TUI application with tui-rs & crossterm

rust-tui-template A template for bootstrapping a Rust TUI application with tui-rs & crossterm. tui-rs The library is based on the principle of immedia

Orhun Parmaksız 72 Dec 31, 2022
A cross-platform graphical process/system monitor with a customizable interface and a multitude of features

A cross-platform graphical process/system monitor with a customizable interface and a multitude of features. Supports Linux, macOS, and Windows. Inspired by both gtop and gotop.

Clement Tsang 5.8k Jan 8, 2023
A universal load testing framework for Rust, with real-time tui support.

rlt A Rust Load Testing framework with real-time tui support. rlt provides a simple way to create load test tools in Rust. It is designed to be a univ

Wenxuan 129 Jul 20, 2024
⚡🦀 Yet another rust system info fetcher.

Yarsi: Yet another rust sys info fetcher ✨ Showcase requirements ?? cargo ?? install with $ curl https://sh.rustup.rs -sSf | sh installation ❤️‍?? Ya

BinaryBrainiacs 8 Jan 26, 2023
Revolutionize handheld gaming with adaptive game settings. Optimize graphics and gameplay experience based on real-time system metrics. Open-source project empowering developers to enhance games on portable devices

Welcome to the server-side application for the HarmonyLink project. This innovative software is developed with the Rust programming language and is ai

Jordon Brooks 5 Jun 28, 2023
A discord bot to view & monitor OpenSea collections, written in Rust

Titan What is this This is a discord bot to monitor OpenSea collections and get info about them, including: Floor Price Activity Sales per Hour And mo

theldb 3 Oct 11, 2022
A resource monitor in your browser, in Rust

axact A resource monitor in your browser, so you can view the state of a VM or some other remote host. Built with Rust & Preact, see the video: https:

amos 87 Apr 13, 2023
Memory usage monitor for process trees

gotta-watch-em-all Executes a process with given arguments and monitors, logs when memory usage grows to a new peak. Example: cargo run -- cargo -- bu

Aaron Friel 8 Dec 8, 2022
Small command-line tool to switch monitor inputs from command line

swmon Small command-line tool to switch monitor inputs from command line Installation git clone https://github.com/cr1901/swmon cargo install --path .

William D. Jones 5 Aug 20, 2022
Socket Monitor: A prettier and simpler alternative to netstat or ss for socket monitoring with the ability to scan for malicious IP addresses.

?? Somo A prettier alternative to netstat or ss for socket monitoring. ⬇️ Installation: 1. Install cargo: From crates.io. 2. Install the somo crate: c

Theodor Peifer 13 Jun 6, 2023
An easy-to-use TUI crate for Rust, based off of the Elm architecture.

Rustea An easy-to-use TUI crate for Rust, based off of the Elm architecture. This is a re-implementation of Go's Tea, created by TJ Holowaychuk. Featu

Laz 82 Dec 21, 2022
Yet another fractal generator (based on glium)

Juliabrot Yet another fractal generator. Juliabrot is a Rust application using the OpenGL Framework to render in realtime. Install Rust To download Ru

Max 2 Feb 27, 2022
TimeKnight is a neat little TUI-based timer app I use in conjunction with a task tracker

TimeKnight is a neat little TUI-based timer app I use in conjunction with a task tracker. It's kind of a secret sauce for productivity (particularly if you have ADHD or have a ridiculously overactive brain).

Monomadic 1 Feb 8, 2022
Tree-based TUI chat client

cove Cove is a TUI client for euphoria.io, a threaded real-time chat platform. It runs on Linux, Windows and macOS. Manual installation This section c

null 8 Nov 16, 2022
belt is a command line app that can show your time from a list of selected time zones

A CLI app to show your time from a list of selected time zones, and a rust lib to parse dates in string formats that are commonly used.

Rollie Ma 23 Nov 4, 2022
Deadliner helps you keep track of the time left for your deadline by dynamically updating the wallpaper of your desktop with the time left.

Deadliner Watch the YouTube video What's Deadliner? Deadliner is a cross-platform desktop application for setting deadline for a project and keeping t

Deadliner 34 Dec 16, 2022
Helps you keep track of time for team members across different time zones & DST changes

Teamdate Helps you keep track of time for team members across different timezones and other daylight saving changes based off their location. Because

Alex Snaps 7 Jan 9, 2023
An experimental real-time operating system (RTOS) written in Rust

An experimental real-time operating system (RTOS) written in Rust

null 0 Nov 14, 2022