Add support for OpenWRT
[pulga.git] / README.md
blobb649fd8e2804c11fc34eafea014e981d9f935574
1 # pulga [![CodeFactor](https://www.codefactor.io/repository/github/carmesim/pulga/badge)](https://www.codefactor.io/repository/github/carmesim/pulga) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) ![GitHub Workflow Status](https://img.shields.io/github/workflow/status/carmesim/pulga/BuildAndValgrind)
3 **Early work in progress**
5 `Pulga` aims to be a customizable, highly performant command-line system information tool.
7 ![Sample](https://user-images.githubusercontent.com/36349314/103445693-67f5ea00-4c56-11eb-8554-481b77cecbd1.png)
9 ## Performance
11 Different than similar tools, such as [Neofetch](https://github.com/dylanaraps/neofetch) and [pfetch](https://github.com/dylanaraps/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.
13 ### Quick benchmark
15 On a Raspberry 3 Model B running Raspbian 10, we ran the following command:
17 ```shell
18 hyperfine --warmup 5 "./pulga" "./neofetch"
19 ```
21 Pulga ([as of this commit](https://github.com/carmesim/pulga/commit/b82da05bf886ae6e87131c63a89da94a3b19edd8)) had a mean runtime of 6.0 ms ± 2.1 ms.
23 Neofetch ([as of this commit](https://github.com/dylanaraps/neofetch/commit/6dd85d67fc0d4ede9248f2df31b2cd554cca6c2f)) had a mean runtime of 1.281 s ± 0.064 s.
25 Overall:
26 ```
27   './pulga' ran
28   213.03 ± 76.66 times faster than './neofetch'
29 ```
31 This is, of course, not a 'fair' match since Pulga does not offer feature-parity with Neofetch.
33 ## Memory safety
35 Even though Pulga makes use of [Unsafe Rust](https://doc.rust-lang.org/book/ch19-01-unsafe-rust.html) and FFI with the C standard library, Pulga does not do away with memory safety.
37 At every commit, the GitHub Actions workflow runs Pulga under [Valgrind](https://valgrind.org/). If Valgrind encounters any error, the build is considered to be a failure.
39 ## Building
41 Cargo and a somewhat recent Rust toolchain must be installed to build. Get [rustup](https://rustup.rs/) if you want to install Rust.
42 ```
43 git clone https://github.com/carmesim/pulga
44 cd pulga
45 cargo build --release     # Build Pulga with no extra dependencies
46 # or
47 cargo build --release --features use_xlib   # Run Pulga with dependencies on X11 and RandR (see the Dependencies section)
48 ```
50 ## To do
52 - [x] Display username and hostname
53 - [x] Display the number of logical CPU cores
54 - [x] Display the maximum CPU frequency
55 - [x] Display uptime
56 - [x] Display the default shell
57 - [x] Display the distro on `systemd`-based systems
58 - [x] Display the kernel version
59 - [x] Display current memory usage
60 - [x] Detect the appropriate ASCII art to show
61 - [x] Display total memory available
62 - [x] Display the current desktop environment
63   * Please open an issue if your D.E. is missing in Pulga
64 - [ ] Display the current window manager
65 - [ ] Display the terminal being used
66 - [ ] Add the ability to customize Pulga through a `pulga.toml` file.
67 - [ ] Display storage usage
68 - [x] Display screen resolution on X11
69 - [x] Display screen resolution on Wayland
70 - [x] Add logos for more Linux distributions
71 - [ ] Add command-line arguments
72   * Only `-r/--random` implemented so far
73 - [ ] Display font and themes
74 - [x] Display the default editor
75 - [x] Display CPU model
76   * Some quirks about this still have to be ironed out
77 - [ ] Display GPU model
79 ## Non-goals
81 Pulga currently focuses solely on Linux distros. Supporting other Unix-like OSes is possible in the future. Supporting Windows is a non-goal.
83 ## Dependencies
85 By default, Pulga does not have any dependencies not handled by [Cargo](https://doc.rust-lang.org/book/ch01-03-hello-cargo.html). Screen resolution is obtained through by looking in `/sys/class/drm/*/modes`, which works in both X11 and Wayland. 
87 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.
89 For this to work, two very common libraries must be installed.
91 * On Debian-based distros:
93 ```shell
94 sudo apt install libx11-dev libxrandr-dev
95 ```
97 * On Arch Linux-based distros:
98 ```shell
99 sudo pacman -S libx11 libxrandr