Skip to content

carmesim/pulga

Repository files navigation

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

  • Display username and hostname
  • Display the number of logical CPU cores
  • Display the maximum CPU frequency
  • Display uptime
  • Display the default shell
  • Display the distro on systemd-based systems
  • Display the kernel version
  • Display current memory usage
  • Detect the appropriate ASCII art to show
  • Display total memory available
  • Display the current desktop environment
    • Please open an issue if your D.E. is missing in Pulga
  • Display the current window manager
  • Display the terminal being used
  • Add the ability to customize Pulga through a pulga.toml file.
  • Display storage usage
  • Display screen resolution on X11
  • Display screen resolution on Wayland
  • Add logos for more Linux distributions
  • Add command-line arguments
    • Only -r/--random implemented so far
  • Display font and themes
  • Display the default editor
  • Display CPU model
    • Some quirks about this still have to be ironed out
  • Display GPU model

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.

  • On Debian-based distros:
sudo apt install libx11-dev libxrandr-dev
  • On Arch Linux-based distros:
sudo pacman -S libx11 libxrandr

About

Rusty system information tool.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published