Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
/baruPublic

A simple system monitor for WM statusbar

NotificationsYou must be signed in to change notification settings

doums/baru

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

barubaru

baru

A simple system monitor for WM statusbar

baru

Baru is a lightweight system monitor for WM status-bar.
It can be used as a provider with any status-bar that can read fromstdout.
Likexmobar,lemonbar,dwm etc…


featuresprerequisiteinstallconfigurationusagecreditslicense

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)
  • weather current condition andtemperature (OpenWeatherMap)
  • dynamic and customizable labels, play nicely with icons andnerd-fonts
  • customizable format output
  • configuration in YAML

Prerequisite

The following system libraries are required:

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

Install

Configuration

The binary looks for the config filebaru.yaml locatedin$XDG_CONFIG_HOME/baru/ (default to$HOME/.config/baru/).
If the config file is not found, baru prints an error and exits.

You can find the full config detailshere.

TIPS: To test and debug your config run baru from the terminal like this:

RUST_LOG=debug baru -l stdout

Use the rootformat option to customize baru output.
You can pick which modules you want to display. Using the special markup%xwherex is the letter of the module.These markups are replaced by the output of the corresponding modules.

Modules available:

  • a battery
  • b brightness
  • c cpu usage
  • d datetime
  • e wired
  • f cpu frequency
  • m memory
  • i mic
  • r weather
  • s sound
  • t temperature
  • w wireless

Module output:
Each module takes aformat option.
%l and%v are respectively the label and the current value of the module.

Config example

format:'%m  %f  %c  %t  %b  %i  %s   %w%e  %a    %d'tick:50# modules configurationbattery:full_design:truelow_level:30full_label:'*'charging_label:'^'discharging_label:'b'low_label:'!'unknown_label:'?'format:'%l %v'# display label and valuebrightness:label:'l'format:'%l %v'cpu_usage:label:'c'high_label:'!'format:'%v %l'cpu_freq:tick:100high_level:60label:'f'high_label:'!'format:'%v %l'memory: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..5label:'t'high_label:'!'format:'%v %l'wired:discrete:truelabel:'e'disconnected_label:'\'format:'%l'# display label onlywireless:interface:wlan0display:Essidmax_essid_len:5label:'w'disconnected_label:'\'format:'%v %l'weather:tick:300# seconds# your openweathermap api keyapi_key:1234567890location:'Metz'unit:metricicons:clear_sky:[ '󰖙', '󰖔' ]# day, nightpartly_cloudy:[ '󰖕', '󰼱' ]cloudy:'󰖐'very_cloudy:'󰖐'shower_rain:'󰖖'rain:'󰖖'thunderstorm:'󰖓'snow:'󰖘'mist:'󰖑'format:'%v'

Usage

baru -h

When spawning baru from your WM/status-bar you can pass the-l file flag
if you want baru to log into a file (useful for debugging).
Logs are written to the directory$XDG_CACHE_HOME/baru/ (defaultto$HOME/.cache/baru/).

baru -l file

Implementation details

Baru gathers the information from/sys and/proc filesystems (filled by thekernel).
Except audio and network modules which use C libraries.
All modules are threaded and loaded on-demand.
Thanks to this modular design (as well Rust and C), baru is lightweight andefficient.
It can run at high refresh rate with a minimal cpu footprint.

The audio module communicates withthePipeWire/PulseAudio
serverthroughclient API toretrieve its data. Wireless and wired
modules use the netlink interface with the helpoflibnl to talk directly
to kernel and retrieve their data.
In addition, wireless module usesthe802.11API.

Dev

Prerequisites

  • Rust
  • CMake
  • libnl and libpulse present on the system
RUST_LOG=trace cargo run -- -l stdout

Credits

Clément Dommerc for providing me with the C code for the libnetlink, wirelesspart.

License

Mozilla Public License 2.0


[8]ページ先頭

©2009-2025 Movatter.jp