Giter Site home page Giter Site logo

doums / baru Goto Github PK

View Code? Open in Web Editor NEW
129.0 1.0 5.0 2.04 MB

A system monitor written in Rust and C

Rust 75.93% CMake 1.39% C 20.83% Shell 1.84%
baru rust monitoring-systems linux archlinux system-monitor window-manager status-bar monitor dwm spectrwm wm-bar bar wm

baru's Introduction

baru baru

baru

A system monitor written in Rust and C.

baru

features

  • date and time
  • battery (level, status, design level based)
  • wireless (state, essid, signal strength)
  • wired (state)
  • audio sink and source (level, muted)
  • brightness
  • cpu usage, frequency and temperature
  • memory (percent or used/total in gigabyte/gibibyte)
  • dynamic and customizable labels
  • customizable format output
  • configuration in YAML

Baru gathers the information from /sys and /proc filesystems (filled by the kernel). Except audio and network modules which use C libraries.
There is no memory leak over time. All modules are threaded. Thanks to this design (as well Rust and C), baru is lightweight and efficient. It can run at high refresh rate with a minimal processor footprint.

The audio module communicates with the PipeWire/PulseAudio server through client API to retrieve its data.
Wireless and wired modules use the netlink interface with the help of libnl to talk directly to kernel and retrieve their data.
In addition, wireless module uses the 802.11 API.

Baru is modular. This means that only the modules you want to see are instantiated and executed.

prerequisite

  • libnl (for wired and wireless modules)
  • libpulse (for sound and mic modules)

install

Rust is a language that compiles to native code and by default statically links all dependencies.
Simply download the latest release of the compiled binary and use it (do not forget to make it executable chmod +x baru).

For Arch Linux users, baru is present as a package in the Arch User Repository.

configuration

The binary looks for the config file baru.yaml located in $XDG_CONFIG_HOME/baru/ (default to $HOME/.config/baru/).
If the config file is not found, baru prints an error and exits.
All options are detailed here.

Example:

format: '%m  %f  %c  %t  %b  %i  %s   %w%e  %a    %d'
tick: 50
battery:
  full_design: true
  low_level: 30
  full_label: '*'
  charging_label: '^'
  discharging_label: 'b'
  low_label: '!'
  unknown_label: '?'
  format: '%l %v'
brightness:
  label: 'l'
  format: '%l %v'
cpu:
  label: 'c'
  high_label: '!'
  format: '%v %l'
cpu_freq:
  tick: 100
  high_level: 60
  label: 'f'
  high_label: '!'
  format: '%v %l'
memory:
  core_inputs: 2..5
  label: 'm'
  high_label: '!'
  format: '%v %l'
mic:
  label: 'i'
  mute_label: '.'
  format: '%v %l'
sound:
  label: 's'
  mute_label: '.'
  format: '%v %l'
temperature:
  core_inputs: 2..5
  label: 't'
  high_label: '!'
  format: '%v %l'
wired:
  discrete: true
  label: 'e'
  disconnected_label: '\'
  format: '%l'
wireless:
  interface: wlan0
  display: Essid
  max_essid_len: 5
  label: 'w'
  disconnected_label: '\'
  format: '%v %l'

usage

$ baru

credits

Clément Dommerc for providing me with the C code for the lib netlink, wireless part.

license

Mozilla Public License 2.0

baru's People

Contributors

doums avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

baru's Issues

Does not display

I installed the AUR package on Manjaro GNOME and setup the config file as best I could. The output appears normal, but nothing is displayed.

cpu:  4%  -  -  -   -- -   -
cpu:  4%  -  bri: 99%  -   wla:Ponde 100: 90%   13h31
cpu:  4%  -  bri: 99%  -   wla:Ponde 100: 90%   13h31
cpu:  4%  -  bri: 99%  -   wla:Ponde 100: 90%   13h31
cpu:  4%  -  bri: 99%  -   wla:Ponde 100: 90%   13h31
cpu:  4%  -  bri: 99%  -   wla:Ponde 100: 90%   13h31
cpu:  4%  -  bri: 99%  -   wla:Ponde 100: 90%   13h31
cpu:  4%  -  bri: 99%  -   wla:Ponde 100: 90%   13h31
cpu:  4%  -  bri: 99%  -   wla:Ponde 100: 90%   13h31
cpu:  4%  -  bri: 99%  -   wla:Ponde 100: 90%   13h31
cpu:  7%  -  bri: 99%  -   wla:Ponde 100: 90%   13h31
cpu:  7%  -  bri: 99%  -   wla:Ponde 100: 90%   13h31
cpu:  7%  -  bri: 99%  -   wla:Ponde 100: 90%   13h31
cpu:  7%  -  bri: 99%  -   wla:Ponde 100: 90%   13h31

baru.yaml

❯ inxi -CG
CPU:       Info: 8-Core model: AMD Ryzen 7 3700X bits: 64 type: MT MCP L2 cache: 4 MiB 
           Speed: 2132 MHz min/max: 2200/5091 MHz Core speeds (MHz): 1: 2132 2: 2180 
           3: 2184 4: 2196 5: 2279 6: 3103 7: 2180 8: 2197 9: 2207 10: 2081 11: 3440 
           12: 3796 13: 3183 14: 2827 15: 2195 16: 2124 
Graphics:  Device-1: NVIDIA TU116M [GeForce GTX 1660 Ti Mobile] driver: nvidia v: 460.39 
           Device-2: Chicony Chicony USB2.0 Camera type: USB driver: uvcvideo 
           Display: x11 server: X.Org 1.20.10 driver: loaded: nvidia resolution: 
           1: 1920x1080~60Hz 2: 1920x1080~144Hz 
           OpenGL: renderer: GeForce GTX 1660 Ti/PCIe/SSE2 v: 4.6.0 NVIDIA 460.39

Great project - instructions need improvement

Congrats for the work.

The instructions to utilize the modules need a lot of work and wording. It is so poorly written that it took me half an hour to figure it out. And supposedly I know my way around.

Question now.
I invoked the modules in i3blocks and noticed that there is a string following every module. For example the memory module is followed by 'mem' (I guess by default because I removed the label instruction.
How do I go about removing the default strings?

Any plans on interactive modules?

Other than the manual, great work.
Kudos

libnetlink error: interface not found

Hi, thank you for the great tool and would love to try baru.

When I run baru I found the following output:

$ baru
-  -  -  -  -  -   --  -    -
libnetlink error: interface not found

My environment is looks like this (will provide more info if it helps):

$ uname -a
Linux archlinux 5.9.1-arch1-1 #1 SMP PREEMPT Sat, 17 Oct 2020 13:30:37 +0000 x86_64 GNU/Linux

$ iwctl --help
                               iwctl version 1.9

Do you have any suggestion to solve the issue?

Thanks

Single output usage

I'm having difficulty using this with dwm since it uses WM_NAME to set the statusbar. Is there a way to make baru output just once and then exit? If not, would it be possible to add this as an argument (ex. --once)?

This is because the only way to change WM_NAME "manually" is to run xsetroot -name $status. With this feature I could do xsetroot -name $(baru --once).

If there is another way to set WM_NAME with baru, please let me know.

Additional features for the wireless module

Is it possible to have a discrete flag for the wireless module, like the one that exists in the wired module?
And is it possible to display both the Essid and Signal for the wireless module?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.