Skip to content

Commit

Permalink
update readme & some cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
doums committed Aug 23, 2024
1 parent 4205b95 commit 4f8e560
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 16 deletions.
23 changes: 10 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,7 @@ Like [xmobar](https://codeberg.org/xmobar/xmobar),

---

- [features](#features)
- [prerequisite](#prerequisite)
- [install](#install)
- [configuration](#configuration)
- [usage](#usage)
- [credits](#credits)
- [license](#license)
[features](#features)[prerequisite](#prerequisite)[install](#install)[configuration](#configuration)[usage](#usage)[credits](#credits)[license](#license)

### features

Expand All @@ -33,8 +27,9 @@ Like [xmobar](https://codeberg.org/xmobar/xmobar),
* brightness
* cpu usage, frequency and temperature
* memory (percent or used/total in gigabyte/gibibyte)
* current weather condition and temperature ([OpenWeather](https://openweathermap.org/))
* dynamic and customizable labels
* weather current condition and
temperature ([OpenWeatherMap](https://openweathermap.org/))
* dynamic and customizable labels, play nicely with icons and [nerd-fonts](https://www.nerdfonts.com/)
* customizable format output
* configuration in YAML

Expand Down Expand Up @@ -127,8 +122,8 @@ weather:
location: 'Metz'
unit: metric
icons:
clear_sky: ['󰖙', '󰖔'] # day, night
partly_cloudy: ['󰖕', '󰼱']
clear_sky: [ '󰖙', '󰖔' ] # day, night
partly_cloudy: [ '󰖕', '󰼱' ]
cloudy: '󰖐'
very_cloudy: '󰖐'
shower_rain: '󰖖'
Expand All @@ -147,15 +142,17 @@ 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/` (default to `$HOME/.cache/baru/`).
Logs are written to the directory `$XDG_CACHE_HOME/baru/` (default
to `$HOME/.cache/baru/`).

```shell
baru -l file
```

### implementation details

Baru gathers the information from `/sys` and `/proc` filesystems (filled by the kernel).\
Baru gathers the information from `/sys` and `/proc` filesystems (filled by the
kernel).\
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 and
Expand Down
4 changes: 4 additions & 0 deletions src/cli.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

use clap::{Parser, ValueEnum};
use serde::{Deserialize, Serialize};

Expand Down
4 changes: 4 additions & 0 deletions src/http.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

use std::time::Duration;

use once_cell::sync::Lazy;
Expand Down
3 changes: 1 addition & 2 deletions src/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,7 @@ impl<'a> ModuleData<'a> {
ModuleState::Failed
}
Err(_) => {
let msg = format!("[{}] module panicked", self.module.name());
error!("{}", &msg);
error!("[{}] module panicked", self.module.name());
ModuleState::Failed
}
};
Expand Down
5 changes: 4 additions & 1 deletion src/modules/weather.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ impl WeatherIcons {
11 => &self.thunderstorm,
13 => &self.snow,
50 => &self.mist,
_ => &self.clear_sky,
_ => {
warn!("unknown weather icon code: {}", code);
&self.clear_sky
}
}
}
}
Expand Down

0 comments on commit 4f8e560

Please sign in to comment.