descriptionFast system information written in Rust
homepage URLhttps://github.com/carmesim/pulga
repository URLhttps://github.com/carmesim/pulga.git
ownervrmiguel99@gmail.com
last changeTue, 2 Feb 2021 01:23:59 +0000 (1 22:23 -0300)
last refreshSat, 27 Apr 2024 10:55:23 +0000 (27 12:55 +0200)
content tags
add:
README.md

pulga CodeFactor License: MIT GitHub Workflow Status

Early work in progress

Pulga aims to be a customizable, highly performant command-line system information tool.

Sample

Performance

Different than similar tools, such as Neofetch and pfetch, which are written in scripting languages, Pulga is written in Rust, focusing on obtaining all of its data mostly using the standard libraries of Rust and C, alongside system files & libraries. Pulga currently runs in under 10 milliseconds even on low-end hardware.

Quick benchmark

On a Raspberry 3 Model B running Raspbian 10, we ran the following command:

hyperfine --warmup 5 "./pulga" "./neofetch"

Pulga (as of this commit) had a mean runtime of 6.0 ms ± 2.1 ms.

Neofetch (as of this commit) had a mean runtime of 1.281 s ± 0.064 s.

Overall:

  './pulga' ran
  213.03 ± 76.66 times faster than './neofetch'

This is, of course, not a 'fair' match since Pulga does not offer feature-parity with Neofetch.

Memory safety

Even though Pulga makes use of Unsafe Rust and FFI with the C standard library, Pulga does not do away with memory safety.

At every commit, the GitHub Actions workflow runs Pulga under Valgrind. If Valgrind encounters any error, the build is considered to be a failure.

Building

Cargo and a somewhat recent Rust toolchain must be installed to build. Get rustup if you want to install Rust.

git clone https://github.com/carmesim/pulga
cd pulga
cargo build --release     # Build Pulga with no extra dependencies
# or
cargo build --release --features use_xlib   # Run Pulga with dependencies on X11 and RandR (see the Dependencies section)

To do

Non-goals

Pulga currently focuses solely on Linux distros. Supporting other Unix-like OSes is possible in the future. Supporting Windows is a non-goal.

Dependencies

By default, Pulga does not have any dependencies not handled by Cargo. Screen resolution is obtained through by looking in /sys/class/drm/*/modes, which works in both X11 and Wayland.

If, for some reason, you'd like to use Xlib to fetch screen resolution instead, you may do that by activating the feature use_xlib. Do note that the default method is much faster. Xlib makes Pulga almost two times slower.

For this to work, two very common libraries must be installed.

sudo apt install libx11-dev libxrandr-dev
sudo pacman -S libx11 libxrandr
shortlog
2021-02-02 Vinícius MiguelAdd support for OpenWRTmaster
2021-01-15 Meraziupdated readme
2021-01-15 MeraziMerged _arts.rc with arts.rc, also started adding the...
2021-01-15 Vinícius MiguelUpdate README.md
2021-01-15 Vinícius R... Add MATE to list of DEs
2021-01-15 Vinícius R... Minor refactorings
2021-01-15 Vinícius R... Simplify distro detection logic
2021-01-15 João M. BezerraFinished distro detection, big refactor
2021-01-15 Vinícius R... WIP distro selection
2021-01-14 João M. BezerraImplement get_id() function for /etc/os-release
2021-01-14 Vinícius R... WIP lookup table for distro ASCII arts
2021-01-09 Vinícius MiguelIgnore disabled monitors
2021-01-09 João M. BezerraResume output of resolution field
2021-01-09 João M. BezerraFixing path join bug
2021-01-09 João M. BezerraFixing cursor end position
2021-01-09 João M. BezerraChanging how formatting and alignment works
...
heads
3 years ago master