This Magisk module contains btop++ for arm64 CPUs

ASUS_I006D:/ # btop --version
btop version: 1.4.7
Compiled with: /data/local/tmp/sysroot/usr/clang19/bin/clang++ (19.0.0git)
Configured with: make STATIC= GPU_SUPPORT=false RSMI_STATIC=
ASUS_I006D:/ # 


Note that in the rest of this document the term "btop" is used instead of "btop++".

The btop executable is installed in /system/bin/usr and a symbolic link is created in /system/bin


The btop executable only needs the standard Android libraries:

ASUS_I006D:/ $ ldd /system/usr/bin/btop
	linux-vdso.so.1 => [vdso] (0x7887913000)
	libc.so => /apex/com.android.runtime/lib64/bionic/libc.so (0x78844cd000)
	libm.so => /apex/com.android.runtime/lib64/bionic/libm.so (0x78848c5000)
	libdl.so => /apex/com.android.runtime/lib64/bionic/libdl.so (0x7884496000)
ASUS_I006D:/ $ 


The btop executable searches the config file btop.conf in these directories in this order:

- the contents of the environment variable XDG_CONFIG_HOME if not empty
- in $HOME/.config/btop if the environment variable HOME is not empty and NOT "/"
- in the directory /data/local/tmp/sysroot/home/btop 

To change the directory to be used for the btop config file, set one of the environment variables mentioned above before executing btop.


Set the environment variable DEBUG to print the config directory used, example:

ASUS_I006D:/ $ DEBUG=y btop
DEBUG: CONFIG_DIR='/data/local/tmp/sysroot/home/btop'
ASUS_I006D:/ $


The btop executable searches the following directories for system themes in this order:

../share/btop/themes (this path is relative to the btop executable)
/system/usr/share/btop/themes
/data/local/tmp/sysroot/usr/share/btop/themes

A sample config file for btop can be found here:

/system/usr/share/btop/btop.conf


Notes

Note that btop needs root access to read and print the network statistics. Without read access for the data in /sys btop prints the string "[limited]" after the IP address.


Mouse support does not work reliable for this btop binary - it's recommended to not use it
If you really want to use the mouse, execute btop in an ssh session to the phone.


The source code for the btop binary is in this repository

https://github.com/aristocratos/btop


The btop binary was compiled using the clang19 tool chain for the phone:

https://xdaforums.com/t/guide-how-to-install-a-toolchain-for-clang-on-phones-without-root-access.4710235/

on the phone.


The patches used to patch the source code for btop are in the directory ./source/patches in this Magisk module

The command to link the btop binary is in the file ./source/compile_btop.sh in the Magisk module.


History

15.08.2024 v1.4.4-v1.0.0 /bs
  initial release

15.07.2026 v1.4.7-v1.0.0 /bs
  updated btop to version 1.4.7
  added code to disable network statistics if the access to /sys/... is not allowed
  added code to print the config directory used if the environment variable DEBUG is set

