btop++ - A monitor of resources

Related tags

CLI btop
Overview

btop++

Linux Usage c++20 btop_version Donate Sponsor Coffee

Index

News

Under development

18 September 2021

The Linux version of btop++ is complete. Released as version 1.0.0

I will be providing statically compiled binaries for a range of architectures in every release for those having problems compiling.

For compilation GCC 10 is required, GCC 11 preferred.

Please report any bugs to the Issues page.

The development plan right now:

  • 1.1.0 Mac OsX support
  • 1.2.0 FreeBSD support
  • 1.3.0 Support for GPU monitoring
  • 1.X.0 Other platforms and features...

Windows support is not in the plans as of now, but if anyone else wants to take it on, I will try to help.

5 May 2021

This project is gonna take some time until it has complete feature parity with bpytop, since all system information gathering will have to be written from scratch without any external libraries. And will need some help in the form of code contributions to get complete support for BSD and OSX.

Documents

CHANGELOG.md

CONTRIBUTING.md

CODE_OF_CONDUCT.md

Description

Resource monitor that shows usage and stats for processor, memory, disks, network and processes.

C++ version and continuation of bashtop and bpytop.

Features

  • Easy to use, with a game inspired menu system.
  • Full mouse support, all buttons with a highlighted key is clickable and mouse scroll works in process list and menu boxes.
  • Fast and responsive UI with UP, DOWN keys process selection.
  • Function for showing detailed stats for selected process.
  • Ability to filter processes.
  • Easy switching between sorting options.
  • Tree view of processes.
  • Send any signal to selected process.
  • UI menu for changing all config file options.
  • Auto scaling graph for network usage.
  • Shows IO activity and speeds for disks
  • Battery meter
  • Selectable symbols for the graphs
  • Custom presets
  • And more...

Themes

Btop++ uses the same theme files as bpytop and bashtop (some color values missing in bashtop themes) .

See themes folder for available themes.

The make install command places the default themes in [$PREFIX or /usr/local]/share/btop/themes. User created themes should be placed in $XDG_CONFIG_HOME/btop/themes or $HOME/.config/btop/themes.

Let me know if you want to contribute with new themes.

Support and funding

You can sponsor this project through github, see my sponsors page for options.

Or donate through paypal or ko-fi.

Any support is greatly appreciated!

Prerequisites

For best experience, a terminal with support for:

  • 24-bit truecolor (See list of terminals with truecolor support)
  • 256-color terminals are supported through 24-bit to 256-color conversion when setting "truecolor" to False in the options or with "-lc/--low-color" arguments.
  • 16 color TTY mode will be activated if a real tty device is detected. Can be forced with "-t/--tty_on" arguments.
  • Wide characters (Are sometimes problematic in web-based terminals)

Also needs a UTF8 locale and a font that covers:

  • Unicode Block “Braille Patterns” U+2800 - U+28FF (Not needed in TTY mode or with graphs set to type: block or tty.)
  • Unicode Block “Geometric Shapes” U+25A0 - U+25FF
  • Unicode Block "Box Drawing" and "Block Elements" U+2500 - U+259F

Notice (Text rendering issues)

  • If you are having problems with the characters in the graphs not looking like they do in the screenshots, it's likely a problem with your systems configured fallback font not having support for braille characters.

  • See Terminess Powerline for an example of a font that includes the braille symbols.

  • See comments by @sgleizes link and @XenHat link in issue #100 for possible solutions.

  • If text are misaligned and you are using Konsole or Yakuake, turning off "Bi-Directional text rendering" is a possible fix.

  • Characters clipping in to each other or text/border misalignments is not bugs caused by btop, but most likely a fontconfig or terminal problem where the braille characters making up the graphs aren't rendered correctly.

  • Look to the creators of the terminal emulator you use to fix these issues if the previous mentioned fixes don't work for you.

Screenshots

Main UI showing details for a selected process

Screenshot 1

Main UI in TTY mode

Screenshot 2

Main UI with custom options

Screenshot 3

Main-menu

Screenshot 3

Options-menu

Screenshot 4

Help-menu

Screenshot 5

Installation

Binary release (statically compiled)

  1. Download btop-(VERSION)-(PLATFORM)-(ARCH).tbz from latest release and unpack to a new folder

  2. Install (from created folder)

    • Run install.sh or:
    # use "make install PREFIX=/target/dir" to set target, default: /usr/local
    # only use "sudo" when installing to a NON user owned directory
    sudo make install
  3. (Optional) Set suid bit to make btop always run as root (or other user)

    Enables signal sending to any process without starting with sudo and can prevent /proc read permissions problems on some systems.

    • Run setuid.sh or:
    # run after make install and use same PREFIX if any was used at install
    # set SU_USER and SU_GROUP to select user and group, default is root:root
    sudo make setuid
  • Uninstall

    • Run uninstall.sh or:
    sudo make uninstall
  • Show help

    make help

Compilation

Needs GCC 10 or higher, (GCC 11 or above strongly recommended for better CPU efficiency in the compiled binary).

The makefile also needs GNU coreutils and sed (should already be installed on any modern distribution).

  1. Install dependencies (example for Ubuntu 21.04 Hirsute)

    sudo apt install coreutils sed git build-essential gcc-11 g++-11
    # use gcc-10 g++-10 if gcc-11 isn't available
  2. Clone repository

    git clone https://github.com/aristocratos/btop.git
    cd btop
  3. Compile

    Append STATIC=true to make command for static compilation.

    Notice! Manually set $ARCH variable if cross-compiling

    Use $ADDFLAGS variable for appending flags to both compiler and linker.

    make
  4. Install

    # use "make install PREFIX=/target/dir" to set target, default: /usr/local
    # only use "sudo" when installing to a NON user owned directory
    sudo make install
  5. (Optional) Set suid bit to make btop always run as root (or other user)

    No need for sudo to enable signal sending to any process and to prevent /proc read permissions problems on some systems.

    # run after make install and use same PREFIX if any was used at install
    # set SU_USER and SU_GROUP to select user and group, default is root:root
    sudo make setuid
  • Uninstall

    sudo make uninstall
  • Remove any object files from source dir

    make clean
  • Remove all object files, binaries and created directories in source dir

    make distclean
  • Show help

    make help

Configurability

All options changeable from within UI. Config and log files stored in $XDG_CONFIG_HOME/btop or $HOME/.config/btop folder

btop.cfg: (auto generated if not found)

#? Config file for btop v. 0.1.0

#* Name of a btop++/bpytop/bashtop formatted ".theme" file, "Default" and "TTY" for builtin themes.
#* Themes should be placed in "../share/btop/themes" relative to binary or "$HOME/.config/btop/themes"
color_theme = "Default"

#* If the theme set background should be shown, set to False if you want terminal background transparency.
theme_background = False

#* Sets if 24-bit truecolor should be used, will convert 24-bit colors to 256 color (6x6x6 color cube) if false.
truecolor = True

#* Set to true to force tty mode regardless if a real tty has been detected or not.
#* Will force 16-color mode and TTY theme, set all graph symbols to "tty" and swap out other non tty friendly symbols.
force_tty = False

#* Define presets for the layout of the boxes. Preset 0 is always all boxes shown with default settings. Max 9 presets.
#* Format: "box_name:P:G,box_name:P:G" P=(0 or 1) for alternate positons, G=graph symbol to use for box.
#* Use withespace " " as seprator between different presets.
#* Example: "cpu:0:default,mem:0:tty,proc:1:default cpu:0:braille,proc:0:tty"
presets = "cpu:1:default,proc:0:default cpu:0:default,mem:0:default,net:0:default cpu:0:block,net:0:tty"

#* Rounded corners on boxes, is ignored if TTY mode is ON.
rounded_corners = True

#* Default symbols to use for graph creation, "braille", "block" or "tty".
#* "braille" offers the highest resolution but might not be included in all fonts.
#* "block" has half the resolution of braille but uses more common characters.
#* "tty" uses only 3 different symbols but will work with most fonts and should work in a real TTY.
#* Note that "tty" only has half the horizontal resolution of the other two, so will show a shorter historical view.
graph_symbol = "braille"

# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty".
graph_symbol_cpu = "default"

# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty".
graph_symbol_mem = "default"

# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty".
graph_symbol_net = "default"

# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty".
graph_symbol_proc = "default"

#* Manually set which boxes to show. Available values are "cpu mem net proc", separate values with whitespace.
shown_boxes = "cpu mem net proc"

#* Update time in milliseconds, recommended 2000 ms or above for better sample times for graphs.
update_ms = 2000

#* Processes sorting, "pid" "program" "arguments" "threads" "user" "memory" "cpu lazy" "cpu responsive",
#* "cpu lazy" sorts top process over time (easier to follow), "cpu responsive" updates top process directly.
proc_sorting = "cpu lazy"

#* Reverse sorting order, True or False.
proc_reversed = False

#* Show processes as a tree.
proc_tree = False

#* Use the cpu graph colors in the process list.
proc_colors = True

#* Use a darkening gradient in the process list.
proc_gradient = True

#* If process cpu usage should be of the core it's running on or usage of the total available cpu power.
proc_per_core = True

#* Show process memory as bytes instead of percent.
proc_mem_bytes = True

#* Use /proc/[pid]/smaps for memory information in the process info box (very slow but more accurate)
proc_info_smaps = False

#* Show proc box on left side of screen instead of right.
proc_left = False

#* Sets the CPU stat shown in upper half of the CPU graph, "total" is always available.
#* Select from a list of detected attributes from the options menu.
cpu_graph_upper = "total"

#* Sets the CPU stat shown in lower half of the CPU graph, "total" is always available.
#* Select from a list of detected attributes from the options menu.
cpu_graph_lower = "total"

#* Toggles if the lower CPU graph should be inverted.
cpu_invert_lower = True

#* Set to True to completely disable the lower CPU graph.
cpu_single_graph = False

#* Show cpu box at bottom of screen instead of top.
cpu_bottom = False

#* Shows the system uptime in the CPU box.
show_uptime = True

#* Show cpu temperature.
check_temp = True

#* Which sensor to use for cpu temperature, use options menu to select from list of available sensors.
cpu_sensor = "Auto"

#* Show temperatures for cpu cores also if check_temp is True and sensors has been found.
show_coretemp = True

#* Set a custom mapping between core and coretemp, can be needed on certain cpus to get correct temperature for correct core.
#* Use lm-sensors or similar to see which cores are reporting temperatures on your machine.
#* Format "x:y" x=core with wrong temp, y=core with correct temp, use space as separator between multiple entries.
#* Example: "4:0 5:1 6:3"
cpu_core_map = ""

#* Which temperature scale to use, available values: "celsius", "fahrenheit", "kelvin" and "rankine".
temp_scale = "celsius"

#* Show CPU frequency.
show_cpu_freq = True

#* Draw a clock at top of screen, formatting according to strftime, empty string to disable.
#* Special formatting: /host = hostname | /user = username | /uptime = system uptime
clock_format = "%H:%M"

#* Update main ui in background when menus are showing, set this to false if the menus is flickering too much for comfort.
background_update = True

#* Custom cpu model name, empty string to disable.
custom_cpu_name = ""

#* Optional filter for shown disks, should be full path of a mountpoint, separate multiple values with whitespace " ".
#* Begin line with "exclude=" to change to exclude filter, otherwise defaults to "most include" filter. Example: disks_filter="exclude=/boot /home/user".
disks_filter = "exclude=/boot"

#* Show graphs instead of meters for memory values.
mem_graphs = True

#* Show mem box below net box instead of above.
mem_below_net = False

#* If swap memory should be shown in memory box.
show_swap = True

#* Show swap as a disk, ignores show_swap value above, inserts itself after first disk.
swap_disk = True

#* If mem box should be split to also show disks info.
show_disks = True

#* Filter out non physical disks. Set this to False to include network disks, RAM disks and similar.
only_physical = True

#* Read disks list from /etc/fstab. This also disables only_physical.
use_fstab = False

#* Toggles if io activity % (disk busy time) should be shown in regular disk usage view.
show_io_stat = True

#* Toggles io mode for disks, showing big graphs for disk read/write speeds.
io_mode = False

#* Set to True to show combined read/write io graphs in io mode.
io_graph_combined = False

#* Set the top speed for the io graphs in MiB/s (100 by default), use format "mountpoint:speed" separate disks with whitespace " ".
#* Example: "/mnt/media:100 /:20 /boot:1".
io_graph_speeds = ""

#* Set fixed values for network graphs in Mebibits. Is only used if net_auto is also set to False.
net_download = 100

net_upload = 100

#* Use network graphs auto rescaling mode, ignores any values set above and rescales down to 10 Kibibytes at the lowest.
net_auto = True

#* Sync the auto scaling for download and upload to whichever currently has the highest scale.
net_sync = False

#* Starts with the Network Interface specified here.
net_iface = "br0"

#* Show battery stats in top right if battery is present.
show_battery = True

#* Set loglevel for "~/.config/btop/error.log" levels are: "ERROR" "WARNING" "INFO" "DEBUG".
#* The level set includes all lower levels, i.e. "DEBUG" will show all logging info.
log_level = "DEBUG"

Command line options

usage: btop [-h] [-v] [-/+t] [-p 
   
    ] [--utf-force] [--debug]

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         show version info and exit
  -lc, --low-color      disable truecolor, converts 24-bit colors to 256-color
  -t, --tty_on          force (ON) tty mode, max 16 colors and tty friendly graph symbols
  +t, --tty_off         force (OFF) tty mode
  -p, --preset 
    
          start with preset, integer value between 0-9
  --utf-force           force start even if no UTF-8 locale was detected
  --debug               start in DEBUG mode: shows microsecond timer for information collect
                        and screen draw functions and sets loglevel to DEBUG

    
   

LICENSE

Apache License 2.0

Issues
  • [REQUEST] Distribute as Flatpak and/or Snap

    [REQUEST] Distribute as Flatpak and/or Snap

    A lot of users across various Linux Distros would have convenient access to this application if it were distributed as Flatpak and/or Snap. It would also greatly help discoverability of this application if it was published there.

    Have you considered publishing this as a Flatpak on Flathub and/or as a Snap on the Snap store? Flatpak is the more popular universal app format out of the two (because it's more open by design), so if you had to choose only one, I'd go with Flatpak.

    enhancement 
    opened by JordyScript 114
  • [BUG] Btop hangs

    [BUG] Btop hangs

    Describe the bug For some reason btop randomly hangs (after a couple of mins or hours), CPU jumps to 100% for btop process.

    To Reproduce Not sure since it's random. Installed from snap edge though.

    Expected behavior

    Screenshots

    [If applicable, add screenshots to help explain your problem.]

    Info (please complete the following information):

    • btop++ version: bpytop -v: 1.0.9
    • Architecture: [x86_64, aarch64, etc.] uname -m
    • Platform: [Linux, FreeBSD, OsX]: Ubuntu 21.04
    • (Linux) Kernel: uname -r: 5.11.0.0-36-generic
    • Terminal used: byobu
    • Font used: default byobu fonts

    Additional context

    contents of ~/.config/btop/btop.log: doesn't exist, only btop.conf

    (try running btop with --debug flag if error.log is empty): OK

    bug 
    opened by jmakov 45
  • [BUG] complains of no UTF-8 while locale *is* UTF-8

    [BUG] complains of no UTF-8 while locale *is* UTF-8

    Describe the bug

    Running on RHEL 7.7 at work, using the statically compiled binary 1.0.9, it complains of no UTF-8 locale detected. While locale is: [jdehaes@berx771 Snape]$ locale LANG=en_US.UTF-8 LC_CTYPE="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8" LC_IDENTIFICATION="en_US.UTF-8" LC_ALL=

    When using the --utf-force flag, btop works perfectly. We have the same on other RHEL 7.x boxes. I can not compile/debug btop on this machine (as its compilers are too old - even with gcc 8.3 -std=c++20 is not available). On a RHEL 8 system this just works. I can compile/debug there (after installing gcc 10 toolchain), but useless as the problem doesn't occur there. The locale settings are identical on that system.

    To Reproduce

    Get a RHEL 7.7 (probably any 7.x will do) system (via docker?) and copy the btop binary. It will complain although locale is UTF-8.

    Expected behavior

    btop can run with the --utf-force flag.

    [jdehaes@berx771 Snape]$ btop ERROR: No UTF-8 locale detected! Use --utf-force argument to force start if you're sure your terminal can handle it.

    [If applicable, add screenshots to help explain your problem.]

    Info (please complete the following information):

    • btop++ version: 1.0.9
    • Binary: static binary from release
    • Architecture: x86_64
    • Platform: Linux
    • (Linux) Kernel: 3.10.0-1062.4.1.el7.x86_64
    • Terminal used: mate-terminal
    • Font used: Noto Mono for Powerline Regular

    Additional context

    contents of ~/.config/btop/btop.log -> nothing there other than no UTF-8 locale detected.

    bug 
    opened by joske 44
  • [BUG] Crashes on startup (on kitty and alacritty)

    [BUG] Crashes on startup (on kitty and alacritty)

    Describe the bug Tried to run on pop OS 21.04. Crashes on startup with the following log:

    /usr/include/c++/11/ranges:540: constexpr std::ranges::iota_view<_Winc, _Bound>::iota_view(std::type_identity_t<_Winc>, st
      3 d::type_identity_t<_Bound>) [with _Winc = int; _Bound = int; std::type_identity_t<_Winc> = int; std::type_identity_t<_Boun
      2 d> = int]: Assertion 'bool(__value <= __bound)' failed.                                                                   
      1 fish: “btop” terminated by signal SIGABRT (Abort)
    

    It seems that it doesn't like the kitty terminal, but sometimes it seemed random. Unfortunately I wasn't taking note of everything before but I think it happens on kitty but not eg. on gnome terminal.

    To Reproduce Run the executable on the kitty terminal.

    Info (please complete the following information):

    • btop++ version: 1.0.2
    • Architecture: x86_64
    • Platform: Linux
    • (Linux) Kernel: 5.11.0-7620-generic
    • Terminal used: kitty
    • Font used: Victor Mono

    Additional context

    contents of ~/.config/btop/btop.log

    (try running btop with --debug flag if error.log is empty)

    2021/09/20 (19:15:41) | ===> btop++ v.1.0.2
    2021/09/20 (19:15:41) | DEBUG: Starting in DEBUG mode!
    2021/09/20 (19:15:41) | INFO: Logger set to DEBUG
    2021/09/20 (19:15:41) | DEBUG: Setting LC_ALL=en_US.UTF-8
    2021/09/20 (19:15:41) | INFO: Running on /dev/pts/1
    
    bug 
    opened by radgeRayden 44
  • [BUG] CPU core temperatures don't update

    [BUG] CPU core temperatures don't update

    Describe the bug

    Temperature for individual cores does not update over time but overall CPU temperature does

    To Reproduce

    Run btop in terminal

    Expected behavior

    Temperature updates for each CPU core

    Screenshots

    Screen Shot 2021-12-13 at 09 23 46

    Info (please complete the following information):

    • btop++ version: 1.1.3
    • Binary: static binary from release (Homebrew)
    • Architecture: x86_64
    • Platform: macOS
    • (OSX/FreeBSD) Os release version: Big Sur 11.6
    • Terminal used: iTerm 2 & macOS Terminal
    • Font used: Fira Code
    bug 
    opened by KyleGoetke 35
  • [BUG] btop leaves bash terminal affected after closing (breaks htop use)

    [BUG] btop leaves bash terminal affected after closing (breaks htop use)

    Describe the bug

    If btop is used in the terminal (tested with gnome-terminal, uxterminal, uxterm, uterm, and lxterminal) and then closed, any subsequent launches of applications which support mouse input are messed up (like htop and dialog)

    Clicking no longer works properly with these other applications and causes strange issues in their GUI.

    To Reproduce

    Run btop and do whatever in it and close it. then run htop and notice mouse input no longer works properly

    Expected behavior

    btop does not affect other applications functionality once closed

    Screenshots

    video linked below

    Info (please complete the following information):

    • btop++ version: v1.0.23
    • Binary: static binary from release
    • Architecture: aarch64
    • Platform: linux
    • (Linux) Kernel: 4.9.140+
    • Terminal used: gnome-terminal (as well as uxterm, uxterm, uterm, and lxterminal) bash 4.4.20
    bug 
    opened by theofficialgman 21
  • in_avail() can always be zero, it is an optimization opportunity only

    in_avail() can always be zero, it is an optimization opportunity only

    in_avail() can always return zero, so libc++'s streams does.

    So, one can not use such a technique to async cin poll.

    One can use poll/select for zero fd, but it will not work for file inputs, like in 'btop < some_file'.

    Best available option - just read input in separate thread. Also, after this commit, we will have an opportunity to remove sleep's from code, and use condition_variable timed_wait.

    Also we should always try quick_exit, instead of plain exit() call, cause:

    1. why bother with threads? let them die fast.
    2. should not overcomplicate shutdown process

    And I do not personally understand, why quick_exit disabled on Darwin... One can always use _Exit()/_exit() instead.

    opened by pg83 18
  • [BUG] Core temperature not shown on Intel CPUs supported by coretemp before SandyBridge on Linux

    [BUG] Core temperature not shown on Intel CPUs supported by coretemp before SandyBridge on Linux

    Btop does not show CPU core temperatures on Intel CPUs supported by coretemp before SandyBridge because these platforms do not support the package temperature sensor file "temp1_input" in the hwmon folder.

    This is documented in the coretemp documentation found here. https://www.kernel.org/doc/html/v5.11/hwmon/coretemp.html

    "The per-package sensor is new; as of now, it is present only in the SandyBridge platform."

    The details are found in the source code. https://elixir.bootlin.com/linux/latest/source/drivers/hwmon/coretemp.c#L460

    /*
     * Find attr number for sysfs:
     * We map the attr number to core id of the CPU
     * The attr number is always core id + 2
     * The Pkgtemp will always show up as temp1_*, if available
     */
    

    This means that on platforms before SandyBridge the coretemp entries actually start with core 0 temperature at "temp2_input" and not with package temperature at "temp1_input".

    Here a sample of an Intel Core i7 860 (codename Lynnfield) https://ark.intel.com/content/www/us/en/ark/products/41316/intel-core-i7860-processor-8m-cache-2-80-ghz.html

    > sensors -u
    coretemp-isa-0000
    Adapter: ISA adapter
    Core 0:
      temp2_input: 40.000
      temp2_max: 83.000
      temp2_crit: 99.000
      temp2_crit_alarm: 0.000
    Core 1:
      temp3_input: 40.000
      temp3_max: 83.000
      temp3_crit: 99.000
      temp3_crit_alarm: 0.000
    Core 2:
      temp4_input: 42.000
      temp4_max: 83.000
      temp4_crit: 99.000
      temp4_crit_alarm: 0.000
    Core 3:
      temp5_input: 40.000
      temp5_max: 83.000
      temp5_crit: 99.000
      temp5_crit_alarm: 0.000
    

    The btop code assumes that all temperature sensors have to start with "temp1_input" and will skip the folders where this is not the case.

    I am creating this issue before writing a fix and sending in a pull request in oder to ask for comments how the code should handle this.

    A quick fix would be to have a special handling for coretemp folders if there are entries starting with "temp2_input" and in this case set the starting index of the for loop running thru the sensors to 2 instead of 1. This would change the existing code the least and should not change the behavior for other users but looks kind of ugly.

    Please let me know what is your opinion on the matter.

    Thank you for this awesome project.

    Best regards, Christian

    To Reproduce

    • Start btop on Intel Core architecture before Sandy Bridge
    • Core temperature is not shown

    Expected behavior

    • Core temperature should be shown on CPU platforms supported by coretemp before Sandy Bridge

    Info:

    • btop++ version: 1.1.0 | btop source commit: 044927b7e5161ba40bfd4e1943e89f4fe49b5c7c
    • Binary: self compiled
    • (If compiled) Compiler and version: g++ v11.1.0
    • Architecture: x86_64
    • Platform: Linux
    • (Linux) Kernel: 5.14.16-arch1-1
    • Terminal used: Alacritty
    • Font used: DejaVu Sans Mono
    bug 
    opened by ChUnterberger 17
  •  [BUG] battery monitoring not working

    [BUG] battery monitoring not working

    Lots of metrics on my system are broken when using btop , while working fine with bpytop.

    To Reproduce I have a Dell XPS 9310 running Arch Linux. Haven't had time to check my other devices yet.

    Expected behavior btop looking super similar to bpytop. Screenshots Bpytop:
    bpytop Btop:
    btop

    Info (please complete the following information):

    • btop++ version: btop version: 1.0.15
    • (Linux) Kernel: Linux Dell-Oskar 5.12.15-arch1-1 #1 SMP PREEMPT Wed, 07 Jul 2021 23:35:29 +0000 x86_64 GNU/Linux
    • Terminal used: Tmux in Alacritty

    Additional context

    
    2021/10/17 (11:59:21) | ===> btop++ v.1.0.15
    2021/10/17 (11:59:21) | WARNING: Failed to get disk/partition stats with statvfs() for: /run/media/NAS
    
    2021/10/17 (11:59:31) | ===> btop++ v.1.0.15
    2021/10/17 (11:59:31) | WARNING: Failed to get disk/partition stats with statvfs() for: /run/media/NAS
    2021/10/17 (11:59:31) | WARNING: Failed to get disk/partition stats with statvfs() for: /run/media/NAS
    2021/10/17 (11:59:33) | WARNING: Failed to get disk/partition stats with statvfs() for: /run/media/NAS
    2021/10/17 (11:59:35) | WARNING: Failed to get disk/partition stats with statvfs() for: /run/media/NAS
    2021/10/17 (11:59:37) | WARNING: Failed to get disk/partition stats with statvfs() for: /run/media/NAS
    2021/10/17 (11:59:39) | WARNING: Failed to get disk/partition stats with statvfs() for: /run/media/NAS
    
    2021/10/17 (12:02:55) | ===> btop++ v.1.0.15
    2021/10/17 (12:02:55) | DEBUG: Starting in DEBUG mode!
    2021/10/17 (12:02:55) | INFO: Logger set to DEBUG
    2021/10/17 (12:02:55) | DEBUG: Using locale de_DE.UTF-8
    2021/10/17 (12:02:55) | INFO: Running on /dev/pts/5
    2021/10/17 (12:02:57) | INFO: Quitting! Runtime: 00:00:02
    
    2021/10/17 (12:03:00) | ===> btop++ v.1.0.15
    2021/10/17 (12:03:00) | DEBUG: Starting in DEBUG mode!
    2021/10/17 (12:03:00) | INFO: Logger set to DEBUG
    2021/10/17 (12:03:00) | DEBUG: Using locale de_DE.UTF-8
    2021/10/17 (12:03:00) | INFO: Running on /dev/pts/5
    2021/10/17 (12:04:26) | INFO: Quitting! Runtime: 00:01:26
    
    bug 
    opened by bionade24 17
  • cmake and automated release packaging with static musl builds

    cmake and automated release packaging with static musl builds

    Why cmake instead of a Makefile?

    • it offers a more flexible build process which comes in handy when adapting to different systems and architectures
    • cpack make packaging trivial and might speed up adoption by distro maintainers
    • ctest will come in handy when test will be added
    • the CMakeList.txt is more readable than a Makefile imho
    • my cmake file is half the size and has all the features of the make file, minus the colorful output, plus packaging instructions and more compiler/linker checks

    also see comments by @WSLUser in #28

    Why static musl builds?

    • in contrast to libc you can use getpwuid in static builds without hidden dynamic dependencies
    • it has a lower minimum kernel requirement of 2.6.39 (earlier 2.6 versions might also work - needs to be tested)

    Automated release builds

    I added a GitHub workflow that is triggered whenever a tag matching 'v*..' is pushed. This workflow will build static musl versions with the following toolchains:

    • x86_64-linux-musl
    • i686-linux-musl
    • aarch64-linux-musl
    • arm-linux-musleabi
    • arm-linux-musleabihf There are more pre-built toolchains available but I lack the hardware to test the produced binaries, so I excluded them for now.

    It will also build dynamically linked amd64 DEB packages for Ubuntu 20.04 (focal) and 21.04 (hirsute). (requested by @lucmichalski in #33 ) I'll add other distro packages and architectures shortly. My priorities are CentOS 8, Alpine Linux and Fedora.

    After the packages have been built, the workflow will automatically create a GitHub release attaching all the packages. It extracts the topmost part of the CHANGELOG.md and uses it as the release notes.

    Notes

    This is still a work in progress and any input/feedback is welcome.

    I also incorporated the Makefile changes from the OSX branch into the cmake file, but I don't have Apple hardware to test it with.

    If the STATIC option is set in the cmake configuration step it checks if getpwuid can be used in static builds and does NOT set the preprocessor define STATIC_BUILD accordingly. Perhaps a renaming of this define or an additional define might be sensible.

    Currently the workflow immediately publishes the release, but it could also be configured to only create a draft that can be reviewed and edited before final release. Let me what you prefer.

    This is actually the first time I ever used GitHub workflows. I could draw a bit from my experience with gitlab CI, but I'm very unsure if I utilized all the workflow features exactly as indented. I'm certain it can be improved a lot and I would appreciate if someone would have a look and review my workflow.

    I added a *.yml entry to the .editorconfig for easier workflow editing. The indentation style corresponds to the existing continuous-build.yml.

    To demonstrate the workflow I added a version tag v1.0.15-1 to my fork with runner and job debug logging enabled: https://github.com/jan-guenter/btop/actions/runs/ https://github.com/jan-guenter/btop/releases/tag/v1.0.15-1

    Todo list

    • [ ] add install script, readme etc. to archive packages like the static builds
    • [ ] add more static builds for additional architectures (see the list of available pre-built musl toochain images)
    • [ ] add more distro packages (especially CentOS 8, Alpine Linux and Fedora)
    • [ ] add architecture variants to the Ubuntu builds
    • [ ] update build and installation instructions in README.md
    • [ ] update snapcraft.yml to use cmake
    opened by jan-guenter 15
  • macOS support

    macOS support

    Hi,

    I've started implementing macOS support. It's not complete at all, I just create this PR to raise awareness, solicit feedback and discussion. If you think this is noise or not appropriate, please delete the PR.

    You have to use gcc 11 from homebrew to compile, as macOS clang does not support a few of the c++20 features you use. Make sure it finds c++-11 as c++ in your PATH (I've symlinked it to c++ in /usr/local/bin and put /usr/local/bin at start of PATH).

    Right now it shows some memory info, CPU name, processes (but no sorting etc) so lots to do still. It works on arm64 (M1) and x86_64 (intel).

    I'm not a c++ (and for sure not in c++20) nor macOS expert, so please comment kindly ;-).

    I know the files are formatted wrongly (vscode defaults). Is there a simple way I can import a style file (like in eclipse) to have your code style (which I prefer ;-)).

    opened by joske 15
  • [REQUEST] Cross compilation support

    [REQUEST] Cross compilation support

    Is your feature request related to a problem? Please describe. I want to cross-compile btop for AArch64, using Yocto project. A quick look through your Makefile tells me the experience will not be pleasent - overriding CXX is a giant red flag in my book.

    Describe the solution you'd like Best would be either fixing the Makefile, or adding CMake support. I know CMake much better than make, so I'm prepared to contribute a CMakeLists.txt if you help me understand what's going on in your Makefile. Changing := to ?= here would be a first step, but I'm not sure it would be sufficient.

    Describe alternatives you've considered I could keep a private, patched fork. But that's a stupid solution.

    Additional context The two approaches I proposed - fixing Makefile or adding CMake support - are only two possibilities, I'm sure there are other options. I want to help with this, and this issue is mostly to open discussion.

    enhancement 
    opened by jaskij 18
  • [REQUEST] Please add

    [REQUEST] Please add "?" as an option to see help

    I know that when using VIM keys shift+h can achieve the same thing but I just feel like ? could be a better alternative.

    I like the fact that shift+k is required since it make it harder to kill by accident. However, I think getting help should have an easier keybinding.

    enhancement 
    opened by ZiViZiViZ 4
  • [REQUEST] Clang support

    [REQUEST] Clang support

    Hello,

    A great step to portability would be a support of modern clang.

    For instance, I have a system without gcc at all and want to build the app.

    May be add some temporary workarounds for clang 14 to build it. It has some of Ranges library.

    Yep, I've read #28. Waiting for cmake support too.

    enhancement 
    opened by ivan-volnov 1
  • Disk IO values shown on all disks

    Disk IO values shown on all disks

    Description

    Under heavy disk IO, like copying large files, the IO values are shown on all disks simultaneosuly

    To Reproduce

    Copy large files from one drive to another

    Expected behavior Only IO values should be displayed over the two disks involved

    Screenshots 2022-04-24T23:00:35,889723268+05:30

    Info (please complete the following information):

    • btop++ version: 1.2.6
    • Binary: static binary from arch community
    • Architecture: x86_64
    • Platform: Linux
    • (Linux) Kernel: 5.17.4-zen1-1.1-zen
    • Terminal used: Kitty
    • Font used: Fira Code
    bug 
    opened by AlfredEVOL 4
  • [BUG] MacOS 12.3.1 SEGFAULT

    [BUG] MacOS 12.3.1 SEGFAULT

    Read the README.md and search for similar issues before posting a bug report!

    Any bug that can be solved by just reading the prerequisites section of the README will likely be ignored.

    Describe the bug

    Running btop will always result in segmentation fault. Clicking the terminal thereafter yields 0;53;17M0;53;17m & attempting to scroll yields 64;20;26M etc.

    To Reproduce

    1. On a MacBook Pro M1 model, install btop through homebrew, e.g.:
    brew install btop
    

    1a. Alternatively, compile using the source with the following command:

    make STATIC=true STRIP=true ADDFLAGS=-march=native OPTFLAGS="-O0 -g"
    
    1. Run btop

    Expected behavior

    Btop to detect terminal size and hardware as required and run without resulting in segmentation fault.

    Screenshots zsh Screen Shot 2022-04-20 at 12 35 57

    bash Screen Shot 2022-04-20 at 12 46 14

    Info (please complete the following information):

    • btop++ version: 1.2.6 (latest)
    • Binary: a) As provided by homebrew; b) Compiled also trialed.
    • (If compiled) Compiler and version: GCC 11.2.0_3 (present in /opt/homebrew/...)
    • Architecture: arm64
    • Platform: MacOS
    • (OSX/FreeBSD) Os release version: Monterey 12.3.1 (Darwin 21.4.0)
    • Terminal used: Alacritty 0.10.1 (2844606), Apple default Terminal.app 2.12.5 (444)
    • Font used: SF Mono

    Additional context

    Running with Alacritty

    2022/04/20 (12:36:27) | ===> btop++ v.1.2.6
    2022/04/20 (12:36:27) | DEBUG: Starting in DEBUG mode!
    2022/04/20 (12:36:27) | INFO: Logger set to DEBUG
    2022/04/20 (12:36:27) | DEBUG: Using locale en_AU.UTF-8
    2022/04/20 (12:36:27) | INFO: Running on /dev/ttys001
    2022/04/20 (12:36:27) | DEBUG: get_sensors(): show_coretemp=1 check_temp=1
    2022/04/20 (12:36:27) | DEBUG: checking intel
    2022/04/20 (12:36:27) | DEBUG: no intel sensors found
    

    Running with Terminal.app

    2022/04/20 (12:35:28) | ===> btop++ v.1.2.6
    2022/04/20 (12:35:28) | DEBUG: Starting in DEBUG mode!
    2022/04/20 (12:35:28) | INFO: Logger set to DEBUG
    2022/04/20 (12:35:28) | DEBUG: Using locale en_AU.UTF-8
    2022/04/20 (12:35:28) | INFO: Running on /dev/ttys002
    2022/04/20 (12:35:28) | DEBUG: get_sensors(): show_coretemp=1 check_temp=1
    2022/04/20 (12:35:28) | DEBUG: checking intel
    2022/04/20 (12:35:28) | DEBUG: no intel sensors found
    

    Same errors are logged regardless of whether the binaries are acquired from brew or compiled from source.

    GDB Backtrace

    $ lldb btop
    (lldb) target create "btop"
    Current executable set to 'btop' (arm64).
    (lldb) r
    Process 10089 launched: '/opt/homebrew/bin/btop' (arm64)
    ERROR: Failed to get size of terminal!
    Process 10089 exited with status = 1 (0x00000001) 
    (lldb) bt all
    error: invalid thread
    
    $ lldb btop
    (lldb) target create "btop"
    Current executable set to 'btop' (arm64).
    (lldb) r
    Process 6130 launched: '/usr/local/bin/btop' (arm64)
    ERROR: Failed to get size of terminal!
    Process 6130 exited with status = 1 (0x00000001)
    (lldb) bt all
    error: invalid thread
    

    Same output across both terminal emulators.

    I initially suspected some similarity with #10, but the advices posted in the thread were not relevant to my issue at hand. If you need further information, please let me know.

    --P

    bug 
    opened by ponte-vecchio 0
Releases(v1.2.6)
Owner
Downtime code generator
null
Serial Data Monitor is a multiplatform (Windows, Linux, Mac, ...) tool to interactively receive/edit/monitor data and send commands to an embedded system via the serial bus

See wiki for full documentation Serial Data Monitor Description Serial Data Monitor is a multiplatform (Windows, Linux, Mac, ...) tool to interactivel

monnoliv 4 Oct 29, 2021
The InitWare Suite of Middleware allows you to manage services and system resources as logical entities called units. Its main component is a service management ("init") system.

InitWare isn't ready to use yet!! Unless you are doing so for fun, to experiment, or to contribute, you most likely do not want to try to install Init

null 144 May 9, 2022
Resources gathered for reverse engineering the FNIRSI-1013D scope

# FNIRSI-1013D-Hack Resources gathered for reverse engineering the FNIRSI-1013D scope As part of what is on EEVBLOG, resources for the reverse engine

null 46 May 10, 2022
C++ Workshop Resources Conducted by the Intellects Forum.

cpp-workshop-resources C++ Workshop Resources Conducted by the Intellects Forum.

AMC-CSE 7 May 25, 2021
Resources for DFIR Professionals Responding to the REvil Ransomware Kaseya Supply Chain Attack

Resources for DFIR Professionals Responding to the REvil Ransomware Kaseya Supply Chain Attack Yesterday Sophos and Huntress Labs identified that Kase

Cado Security 168 Apr 28, 2022
Current and past resources for the UNSW courses I have tutored.

James' tutoring resources The home for the code/solutions/etc. from my tutorials, as well as any other resources as I see fit. Table of contents Cours

James Davidson 13 Feb 20, 2022
Competitive Programming Implementations, Resources, Solutions, and Tools

In competitive programming contests, one must write computer programs capable of solving clear-cut problems under the given contraints and limits. Most competitive programmers use C++, Java, or Python.

Dong Liu 14 Sep 23, 2021
Official ACM CSS PEC repository for resources and all things Open source

Contributing Guidelines Ahoy there! Welcome to the PEC-ACM Open Source Repository. We request you to read the whole guidelines before making any pull

PEC CSS 67 May 16, 2022
A list of excellent resources for anyone to deepen their understanding with regards to Windows Kernel Exploitation and general low level security.

WinKernel-Resources A list of excellent resources for anyone trying to deepen their understanding with regards to Windows Kernel Exploitation and gene

Vector Security 20 Mar 27, 2022
The Repository Contains all about Data Structure and Algorithms with Practice problems, series, and resources to follow!

?? The Complete DSA Preparation ?? This repository contains all the DSA (Data-Structures, Algorithms, 450 DSA by Love Babbar Bhaiya,STriver Series ,FA

Pawan Roshan Gupta 6 Jan 8, 2022
Design files and resources for building a wireless N64 controller

wireless-n64-controller This project and its documentation is a Work-In-Progress. I'm still working on writing everything down and working out kinks i

Spencer Fraint 28 Mar 27, 2022
Resources for JUCE-based audio development on the Raspberry Pi

JUCE4Pi Resources for JUCE-based audio development on the Raspberry Pi Raspberry Pi / Linux git clone https://github.com/juce-framework/JUCE.git sudo

null 5 Dec 3, 2021
Archive Extension Loader is a Cyberpunk 2077 mod that allows you to expand game resources that are currently not suitable for modifications without conflicts.

ArchiveXL Archive Extension Loader allows you to expand game resources that are currently not suitable for modifications without conflicts. Installati

Pavel Siberx 8 Apr 1, 2022
Metin2 Resource Dumper/Extractor Tool. Dump 100% of the resources from almost any Metin2 Client

PackDumper Metin2 Resource Dumper/Extractor Tool. Dump 100% of the resources from almost any Metin2 Client How to Compile ✔️ Clone the project and com

null 10 May 5, 2022
Simple library for embedding static resources into C++ binaries using CMake

libromfs libromfs is an easy way to bundle resources directly into any C++ application and access them through a simple interface. The main advantage

WerWolv 22 Apr 4, 2022
Awesome-lockfree - A collection of resources on wait-free and lock-free programming

Awesome Lock-Free A collection of resources on wait-free and lock-free programming. ?? ?? ?? Even better resource from MattPD: C++ links: atomics, loc

Erik Rigtorp 1.3k May 10, 2022
This tries to be a minimal cmake example, that covers sources resources dependencies and packaging.

Minimal CMake Example This project tries to be a minimal cmake example. It covers sources, resources, dependencies and packaging. I created this proje

Arne Döring 151 Apr 20, 2022
Resources and forum for the Chinese community, maintained and moderated by CoinSummer & PL.

Awesome Filecoin 请注意:本文中的链接并非全部是官方链接,部分链接是第三方链接,有些甚至是收费链接,请大家注意区分。 1. Website 1.1 浏览器 FilFox - 6Block 团队开发的 Filecoin 浏览器 Filscan - IPFS原力团队开发的 Filecoi

Filecoin 345 May 7, 2022
Simple Kernel Mode Data Pointer Swap, Credits To FoxiTV On UC for Great Resources About This Topic

Data-Pointer-Swap Simple Kernel Mode Data Pointer Swap, Credits To FoxiTV On UC for Great Resources About This Topic. This Source Was Made Back In Aug

null 7 Apr 1, 2022
A DC power monitor and data logger

Hoverboard Power Monitor I wanted to gain a better understanding of the power consumption of my hoverboard during different riding situations. For tha

Niklas Roy 22 May 1, 2021
audio monitor filter for OBS Studio

Audio Monitor dock and filter for OBS Studio Plugin for OBS Studio to add Audio Monitor dock and filter. It allows you to put the audio of a OBS sourc

Exeldro 166 May 4, 2022
Port of my M5Stack Core 2 audio monitor project to generic ESP32s with TFT screens

ESP32 Audio Monitor This is a port of this project to work with any ESP32 device with a TFT display. You can watch a video explainer here (YouTube) wh

atomic14 37 Apr 29, 2022
Heart Rate Monitor for FPV drones

Heart Rate Monitor for FPV drones Watch your heart rate on Betaflight OSD ?? See how excited you are while: Diving the highest skyscraper ?? Flying lo

Alexey Stankevich 15 Apr 11, 2022
ON AIR or OFF AIR Monitor with WFH

wfh_monitor_m5 M5 Stack ON AIR or OFF AIR Monitor with WFH Dependency Arduino IDE==1.8.13 Blynk==1.0.0 Setup Hardware M5 Stack Smartphone(Android or i

karaage 4 Feb 26, 2022
A tiny external monitor for PC using STM32 and ST7789. Connects to PC over USB and displays the captured screen on ST7789 (240x240) display.

STM32 Tiny Monitor A super tiny monitor for your PC, suitable for your pet ant. A python script sends the captured screen over USB to the STM32 microc

Avra Mitra 60 May 10, 2022
Vaccine Monitor app implemented in C with system Programming techniques.Projects implemented as part of the course Syspro K24

System_Programming_Projects Vaccine Monitor app implemented in C with system Programming techniques.Projects implemented as part of the course Syspro

Aristi_Papastavrou 10 Dec 30, 2021
A framework to monitor and improve the performance of PostgreSQL using Machine Learning methods.

pg_plan_inspector pg_plan_inspector is being developed as a framework to monitor and improve the performance of PostgreSQL using Machine Learning meth

suzuki hironobu 158 May 12, 2022
Universal State Monitor software for home automation input devices

Universal State Monitor Copyright 2019-2021 SuperHouse Automation Pty Ltd www.superhouse.tv A binary state monitor for DIY home automation projects. T

SuperHouse Automation 3 Aug 24, 2021