battery info; prepare for hyprland/pulse/nm

This commit is contained in:
Daniel Bulant 2025-01-10 23:42:27 +01:00
parent 864159ef36
commit 53544c6dbe
No known key found for this signature in database
7 changed files with 445 additions and 43 deletions

346
Cargo.lock generated
View file

@ -42,6 +42,7 @@ dependencies = [
"cfg-if",
"getrandom",
"once_cell",
"serde",
"version_check",
"zerocopy",
]
@ -109,6 +110,16 @@ dependencies = [
"libc",
]
[[package]]
name = "annotate-snippets"
version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ccaf7e9dfbb6ab22c82e473cd1a8a7bd313c19a5b7e40970f3d89ef5a5c9e81e"
dependencies = [
"unicode-width",
"yansi-term",
]
[[package]]
name = "anstream"
version = "0.6.18"
@ -403,6 +414,28 @@ dependencies = [
"windows-sys 0.59.0",
]
[[package]]
name = "async-stream"
version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476"
dependencies = [
"async-stream-impl",
"futures-core",
"pin-project-lite",
]
[[package]]
name = "async-stream-impl"
version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d"
dependencies = [
"proc-macro2",
"quote 1.0.38",
"syn 2.0.96",
]
[[package]]
name = "async-task"
version = "4.7.1"
@ -512,6 +545,23 @@ version = "0.22.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
[[package]]
name = "battery"
version = "0.7.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b4b624268937c0e0a3edb7c27843f9e547c320d730c610d3b8e6e8e95b2026e4"
dependencies = [
"cfg-if",
"core-foundation 0.7.0",
"lazycell",
"libc",
"mach",
"nix 0.19.1",
"num-traits",
"uom",
"winapi",
]
[[package]]
name = "bincode"
version = "1.3.3"
@ -521,6 +571,27 @@ dependencies = [
"serde",
]
[[package]]
name = "bindgen"
version = "0.69.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "271383c67ccabffb7381723dea0672a673f292304fcb45c01cc648c7a8d58088"
dependencies = [
"annotate-snippets",
"bitflags 2.7.0",
"cexpr",
"clang-sys",
"itertools 0.12.1",
"lazy_static",
"lazycell",
"proc-macro2",
"quote 1.0.38",
"regex",
"rustc-hash",
"shlex",
"syn 2.0.96",
]
[[package]]
name = "bit-set"
version = "0.8.0"
@ -723,6 +794,15 @@ version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c"
[[package]]
name = "cexpr"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766"
dependencies = [
"nom",
]
[[package]]
name = "cfg-expr"
version = "0.15.8"
@ -765,6 +845,17 @@ dependencies = [
"windows-targets 0.52.6",
]
[[package]]
name = "clang-sys"
version = "1.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4"
dependencies = [
"glob",
"libc",
"libloading",
]
[[package]]
name = "clap"
version = "4.5.26"
@ -861,13 +952,41 @@ dependencies = [
"crossbeam-utils",
]
[[package]]
name = "convert_case"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca"
dependencies = [
"unicode-segmentation",
]
[[package]]
name = "cookie-factory"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9885fa71e26b8ab7855e2ec7cae6e9b380edff76cd052e07c683a0319d51b3a2"
dependencies = [
"futures",
]
[[package]]
name = "core-foundation"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171"
dependencies = [
"core-foundation-sys 0.7.0",
"libc",
]
[[package]]
name = "core-foundation"
version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f"
dependencies = [
"core-foundation-sys",
"core-foundation-sys 0.8.7",
"libc",
]
@ -877,10 +996,16 @@ version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b55271e5c8c478ad3f38ad24ef34923091e0548492a266d19b3c0b4d82574c63"
dependencies = [
"core-foundation-sys",
"core-foundation-sys 0.8.7",
"libc",
]
[[package]]
name = "core-foundation-sys"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac"
[[package]]
name = "core-foundation-sys"
version = "0.8.7"
@ -1132,6 +1257,27 @@ dependencies = [
"syn 0.11.11",
]
[[package]]
name = "derive_more"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05"
dependencies = [
"derive_more-impl",
]
[[package]]
name = "derive_more-impl"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22"
dependencies = [
"proc-macro2",
"quote 1.0.38",
"syn 2.0.96",
"unicode-xid 0.2.6",
]
[[package]]
name = "digest"
version = "0.10.7"
@ -1755,6 +1901,12 @@ dependencies = [
"xml-rs",
]
[[package]]
name = "glob"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2"
[[package]]
name = "glow"
version = "0.14.2"
@ -2077,6 +2229,39 @@ dependencies = [
"tracing",
]
[[package]]
name = "hyprland"
version = "0.4.0-beta.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc9c1413b6f0fd10b2e4463479490e30b2497ae4449f044da16053f5f2cb03b8"
dependencies = [
"ahash",
"async-stream",
"derive_more",
"either",
"futures-lite",
"hyprland-macros",
"num-traits",
"once_cell",
"paste",
"phf",
"serde",
"serde_json",
"serde_repr",
"tokio",
]
[[package]]
name = "hyprland-macros"
version = "0.4.0-beta.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "69e3cbed6e560408051175d29a9ed6ad1e64a7ff443836addf797b0479f58983"
dependencies = [
"proc-macro2",
"quote 1.0.38",
"syn 2.0.96",
]
[[package]]
name = "iana-time-zone"
version = "0.1.61"
@ -2084,7 +2269,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220"
dependencies = [
"android_system_properties",
"core-foundation-sys",
"core-foundation-sys 0.8.7",
"iana-time-zone-haiku",
"js-sys",
"wasm-bindgen",
@ -2486,6 +2671,12 @@ version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
[[package]]
name = "lazycell"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
[[package]]
name = "lebe"
version = "0.5.2"
@ -2544,6 +2735,34 @@ dependencies = [
"redox_syscall 0.5.8",
]
[[package]]
name = "libspa"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "65f3a4b81b2a2d8c7f300643676202debd1b7c929dbf5c9bb89402ea11d19810"
dependencies = [
"bitflags 2.7.0",
"cc",
"convert_case",
"cookie-factory",
"libc",
"libspa-sys",
"nix 0.27.1",
"nom",
"system-deps",
]
[[package]]
name = "libspa-sys"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bf0d9716420364790e85cbb9d3ac2c950bde16a7dd36f3209b7dfdfc4a24d01f"
dependencies = [
"bindgen",
"cc",
"system-deps",
]
[[package]]
name = "linux-raw-sys"
version = "0.4.15"
@ -2632,6 +2851,15 @@ dependencies = [
"num-traits",
]
[[package]]
name = "mach"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa"
dependencies = [
"libc",
]
[[package]]
name = "malloc_buf"
version = "0.0.6"
@ -2877,12 +3105,46 @@ dependencies = [
"jni-sys",
]
[[package]]
name = "networkmanager"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "36c7a94a505f4bdf5c605ade8a131f7487bbb80170ac27051ba569aa21598cd8"
dependencies = [
"dbus",
"num-derive",
"num-traits",
]
[[package]]
name = "new_debug_unreachable"
version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086"
[[package]]
name = "nix"
version = "0.19.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b2ccba0cfe4fdf15982d1674c69b1fd80bad427d293849982668dfe454bd61f2"
dependencies = [
"bitflags 1.3.2",
"cc",
"cfg-if",
"libc",
]
[[package]]
name = "nix"
version = "0.27.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053"
dependencies = [
"bitflags 2.7.0",
"cfg-if",
"libc",
]
[[package]]
name = "nix"
version = "0.29.0"
@ -3487,6 +3749,34 @@ dependencies = [
"futures-io",
]
[[package]]
name = "pipewire"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08e645ba5c45109106d56610b3ee60eb13a6f2beb8b74f8dc8186cf261788dda"
dependencies = [
"anyhow",
"bitflags 2.7.0",
"libc",
"libspa",
"libspa-sys",
"nix 0.27.1",
"once_cell",
"pipewire-sys",
"thiserror",
]
[[package]]
name = "pipewire-sys"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "849e188f90b1dda88fe2bfe1ad31fe5f158af2c98f80fb5d13726c44f3f01112"
dependencies = [
"bindgen",
"libspa-sys",
"system-deps",
]
[[package]]
name = "pkg-config"
version = "0.3.31"
@ -3967,7 +4257,7 @@ dependencies = [
"ashpd",
"block2",
"core-foundation 0.10.0",
"core-foundation-sys",
"core-foundation-sys 0.8.7",
"js-sys",
"log",
"objc2",
@ -4013,18 +4303,23 @@ checksum = "6c20b6793b5c2fa6553b250154b78d6d0db37e72700ae35fad9387a46f487c97"
name = "rshell"
version = "0.1.0"
dependencies = [
"battery",
"chrono",
"clap",
"color_quant",
"cushy",
"dbus",
"freedesktop-desktop-entry",
"fuzzy-matcher",
"hsl",
"http-cache-reqwest",
"hyprland",
"image",
"itertools 0.10.5",
"mpris",
"networkmanager",
"palette",
"pipewire",
"plotters",
"reqwest",
"reqwest-middleware",
@ -4059,9 +4354,9 @@ dependencies = [
[[package]]
name = "rustls"
version = "0.23.20"
version = "0.23.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5065c3f250cbd332cd894be57c40fa52387247659b14a2d6041d121547903b1b"
checksum = "8f287924602bf649d949c63dc8ac8b235fa5387d394020705b80c4eb597ce5b8"
dependencies = [
"once_cell",
"rustls-pki-types",
@ -4170,7 +4465,7 @@ checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02"
dependencies = [
"bitflags 2.7.0",
"core-foundation 0.9.4",
"core-foundation-sys",
"core-foundation-sys 0.8.7",
"libc",
"security-framework-sys",
]
@ -4181,7 +4476,7 @@ version = "2.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32"
dependencies = [
"core-foundation-sys",
"core-foundation-sys 0.8.7",
"libc",
]
@ -4593,7 +4888,7 @@ version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4"
dependencies = [
"core-foundation-sys",
"core-foundation-sys 0.8.7",
"libc",
]
@ -5131,6 +5426,16 @@ version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1"
[[package]]
name = "uom"
version = "0.30.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e76503e636584f1e10b9b3b9498538279561adcef5412927ba00c2b32c4ce5ed"
dependencies = [
"num-traits",
"typenum",
]
[[package]]
name = "url"
version = "2.5.4"
@ -6165,6 +6470,15 @@ version = "0.8.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fdd20c5420375476fbd4394763288da7eb0cc0b8c11deed431a91562af7335d3"
[[package]]
name = "yansi-term"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fe5c30ade05e61656247b2e334a031dfd0cc466fadef865bdcdea8d537951bf1"
dependencies = [
"winapi",
]
[[package]]
name = "yazi"
version = "0.1.6"
@ -6216,7 +6530,7 @@ dependencies = [
"futures-core",
"futures-util",
"hex",
"nix",
"nix 0.29.0",
"ordered-stream",
"serde",
"serde_repr",
@ -6360,9 +6674,9 @@ dependencies = [
[[package]]
name = "zvariant"
version = "5.1.0"
version = "5.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1200ee6ac32f1e5a312e455a949a4794855515d34f9909f4a3e082d14e1a56f"
checksum = "55e6b9b5f1361de2d5e7d9fd1ee5f6f7fcb6060618a1f82f3472f58f2b8d4be9"
dependencies = [
"endi",
"enumflags2",
@ -6376,9 +6690,9 @@ dependencies = [
[[package]]
name = "zvariant_derive"
version = "5.1.0"
version = "5.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "687e3b97fae6c9104fbbd36c73d27d149abf04fb874e2efbd84838763daa8916"
checksum = "573a8dd76961957108b10f7a45bac6ab1ea3e9b7fe01aff88325dc57bb8f5c8b"
dependencies = [
"proc-macro-crate",
"proc-macro2",
@ -6389,9 +6703,9 @@ dependencies = [
[[package]]
name = "zvariant_utils"
version = "3.0.2"
version = "3.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "20d1d011a38f12360e5fcccceeff5e2c42a8eb7f27f0dcba97a0862ede05c9c6"
checksum = "ddd46446ea2a1f353bfda53e35f17633afa79f4fe290a611c94645c69fe96a50"
dependencies = [
"proc-macro2",
"quote 1.0.38",

View file

@ -28,9 +28,15 @@ fuzzy-matcher = "0.3.5"
freedesktop-desktop-entry = "0.7.5"
which = "7.0.1"
chrono = "0.4.39"
hyprland = "0.4.0-beta.2"
pipewire = "0.8.0"
networkmanager = "0.4"
dbus = "0.9"
battery = "0.7.8"
[patch.crates-io]
winit = { path = "../winit" }
# winit = { git = "https://github.com/danbulant/winit", branch = "ls_release" }
[profile.release]
debug = true

58
src/bar/battery.rs Normal file
View file

@ -0,0 +1,58 @@
use battery::State;
use cushy::{styles::components::TextColor, widget::MakeWidget};
use crate::theme::{TEXT_BATTERY, TEXT_TEMP, WIDGET_PADDING};
const BATTERY_LOW: &str = "󱃍";
const BATTERY_CHARGING: [&str; 11] = ["󰢟", "󰢜", "󰂆", "󰂇", "󰂈", "󰢝", "󰂉", "󰢞", "󰂊", "󰂋", "󰂅"];
const BATTERY_NORMAL: [&str; 11] = ["󰂎", "󰁺", "󰁻", "󰁼", "󰁽", "󰁾", "󰁿", "󰂀", "󰂁", "󰂂", "󰁹"];
pub fn battery() -> impl MakeWidget {
let manager = battery::Manager::new();
let Ok(manager) = manager else {
return "".make_widget();
};
let Ok(mut batteries) = manager.batteries() else {
return "".make_widget();
};
// for (idx, maybe_battery) in batteries.enumerate() {
// let Ok(battery) = maybe_battery else { continue };
// println!("Battery #{}:", idx);
// println!("Vendor: {:?}", battery.vendor());
// println!("Model: {:?}", battery.model());
// println!("State: {:?}", battery.state());
// println!("Time to full charge: {:?}", battery.time_to_full());
// println!("Time to empty: {:?}", battery.time_to_empty());
// println!("State of charge: {:?}", battery.state_of_charge());
// println!("State of health: {:?}", battery.state_of_health());
// println!("Energy rate: {:?}", battery.energy_rate());
// println!("Temperature: {:?}", battery.temperature());
// println!("State: {:?}", battery.state());
// println!("");
// }
let Some(Ok(battery)) = batteries.next() else {
return "".make_widget();
};
let state = battery.state();
let charge = battery.state_of_charge();
let icon = match state {
State::Charging => BATTERY_CHARGING[(charge.value * 10.) as usize],
State::Discharging => BATTERY_NORMAL[(charge.value * 10.) as usize],
State::Empty => BATTERY_LOW,
State::Full => "󱟢",
State::Unknown | _ => "󰂑",
};
let percent = (charge.value * 100.) as u8;
format!(" {} {}% ", icon, percent)
.with(&TextColor, TEXT_BATTERY)
.pad_by(WIDGET_PADDING)
.centered()
.make_widget()
}

View file

@ -1,3 +1,4 @@
use battery::battery;
use cushy::{
figures::{
units::{Lp, UPx},
@ -7,16 +8,18 @@ use cushy::{
styles::{
components::{
BaseLineHeight, BaseTextSize, CornerRadius, DefaultBackgroundColor, FontWeight,
WidgetBackground,
},
FontFamilyList,
},
value::Dynamic,
value::{Dynamic, Source},
widget::MakeWidget,
Application, Open,
};
use crate::theme::{BG_DEFAULT, CORNER_RADIUS, DEFAULT_FONT_WEIGHT, TEXT_FONT, TEXT_SIZE};
mod battery;
mod spotify;
mod time;
@ -24,26 +27,45 @@ pub fn start_bar(app: &mut impl Application) -> cushy::Result {
let monitors = (app.as_app().monitors()).unwrap();
let mut monitor_size: Size<UPx> = monitors.available[0].size().into();
monitor_size.height = UPx::new(40);
monitor_size.width = UPx::new((monitor_size.width.get() as f64 / 1.25) as _);
let size = Dynamic::new(monitor_size);
let mut window = (time::time_widget().pad())
.and(spotify::spotify_controls().pad())
.into_columns()
.centered()
.expand_horizontally()
.height(Lp::points(30))
.with(&BaseTextSize, TEXT_SIZE)
.with(&BaseLineHeight, TEXT_SIZE)
.with(&DefaultBackgroundColor, BG_DEFAULT)
.with(&CornerRadius, CORNER_RADIUS)
.with(&FontWeight, DEFAULT_FONT_WEIGHT)
.into_window()
.inner_size(size.clone())
.titled("rshell")
.transparent()
.app_name("rshell")
.decorated(false)
.resize_to_fit(false)
.window_level(WindowLevel::AlwaysOnTop);
let mut window = ((time::time_widget()
.expand_vertically()
.with(&WidgetBackground, BG_DEFAULT)
.pad())
.and(
spotify::spotify_controls()
.expand_vertically()
.with(&WidgetBackground, BG_DEFAULT)
.pad(),
)
.into_columns()
.centered()
.expand_horizontally())
.and(
battery()
.expand_vertically()
.with(&WidgetBackground, BG_DEFAULT)
.pad(),
)
.into_columns()
.centered()
.expand_horizontally()
.width(monitor_size.width)
.height(Lp::points(30))
.with(&BaseTextSize, TEXT_SIZE)
.with(&BaseLineHeight, TEXT_SIZE)
.with(&DefaultBackgroundColor, BG_DEFAULT)
.with(&CornerRadius, CORNER_RADIUS)
.with(&FontWeight, DEFAULT_FONT_WEIGHT)
.into_window()
.inner_size(size.clone())
.titled("rshell")
.transparent()
.app_name("rshell")
.decorated(false)
.resize_to_fit(false)
.window_level(WindowLevel::AlwaysOnTop);
let mut family = FontFamilyList::default();
for font in TEXT_FONT.iter() {

View file

@ -80,7 +80,6 @@ pub fn spotify_controls() -> impl MakeWidget {
.pad_by(WIDGET_PADDING),
)
.into_columns()
.with(&WidgetBackground, BG_DEFAULT)
// .with(&WidgetBackground, vibrancy.map_each(|vib| vib.primary.unwrap_or(Color::BLACK).into()))
}

View file

@ -45,5 +45,4 @@ pub fn time_widget() -> impl MakeWidget {
.with(&TextColor, TEXT_CLOCK)
.pad_by(WIDGET_PADDING)
.centered()
.with(&WidgetBackground, BG_DEFAULT)
}

View file

@ -3,13 +3,13 @@ use cushy::{
styles::{Color, Dimension, Edges, Weight},
};
pub const CORNER_RADIUS: Dimension = Dimension::Px(Px::new(10));
pub const CORNER_RADIUS: Dimension = Dimension::Px(Px::new(8));
pub const TEXT_SIZE: Dimension = Dimension::Px(Px::new(13));
pub const WIDGET_PADDING: Edges<Dimension> = Edges {
left: Dimension::Px(Px::new(6)),
right: Dimension::Px(Px::new(6)),
top: Dimension::Px(Px::new(3)),
bottom: Dimension::Px(Px::new(3)),
left: Dimension::Px(Px::new(9)),
right: Dimension::Px(Px::new(9)),
top: Dimension::Px(Px::new(4)),
bottom: Dimension::Px(Px::new(4)),
};
pub const DEFAULT_FONT_WEIGHT: Weight = Weight::MEDIUM;
@ -21,6 +21,10 @@ pub const TEXT_CPU: Color = Color(0xff671fFF);
pub const TEXT_MEM: Color = Color(0x1DB954FF);
pub const TEXT_TEMP: Color = Color(0x97f993FF);
pub const TEXT_AUDIO: Color = Color(0xF7E733FF);
pub const TEXT_AUDIO_MUTED: Color = Color(0xD81E5BFF);
pub const TEXT_BATTERY: Color = Color(0x6bb0d9FF);
pub const TEXT_FONT: [&str; 5] = [
"Inter",
"Iosevka",