1
0
Fork 0
mirror of https://github.com/Zedfrigg/ironbar.git synced 2025-09-15 19:26:58 +02:00

feat(sysinfo): expose values as ironvars

This commit is contained in:
Jake Stanger 2025-02-23 16:12:02 +00:00
commit b83f26cb1a
No known key found for this signature in database
GPG key ID: C51FC8F9CB0BEA61
13 changed files with 410 additions and 152 deletions

View file

@ -1,4 +1,4 @@
use crate::await_sync;
use crate::{await_sync, Ironbar};
use color_eyre::Result;
use std::collections::HashMap;
use std::path::Path;
@ -192,7 +192,11 @@ impl Clients {
#[cfg(feature = "sys_info")]
pub fn sys_info(&mut self) -> Arc<sysinfo::Client> {
self.sys_info
.get_or_insert_with(|| Arc::new(sysinfo::Client::new()))
.get_or_insert_with(|| {
let client = Arc::new(sysinfo::Client::new());
Ironbar::variable_manager().register_namespace("sysinfo", client.clone());
client
})
.clone()
}