adding aider to gitignore and fixing padding

This commit is contained in:
Chris Cochrun 2025-06-15 15:28:24 -05:00
parent 81c42943aa
commit eb83bb3c38
2 changed files with 47 additions and 22 deletions

1
.gitignore vendored
View file

@ -1,2 +1,3 @@
target/ target/
.direnv/ .direnv/
.aider*

View file

@ -126,8 +126,7 @@ impl Panel {
None None
} }
}; };
( let mut app = Self {
Self {
system: System::new_all(), system: System::new_all(),
disks: Disks::new_with_refreshed_list(), disks: Disks::new_with_refreshed_list(),
workspaces: workspaces.unwrap().to_vec(), workspaces: workspaces.unwrap().to_vec(),
@ -142,9 +141,11 @@ impl Panel {
active_window_icon_raster, active_window_icon_raster,
battery, battery,
system_tray: None, system_tray: None,
}, };
Task::none(),
) // let sys_task = Task::perform(app.add_sys_tray(), |app| app = app );
(app, Task::none())
} }
fn namespace(&self) -> String { fn namespace(&self) -> String {
String::from("panel") String::from("panel")
@ -204,7 +205,13 @@ impl Panel {
Message::ActiveWindowChange(w) => { Message::ActiveWindowChange(w) => {
debug!(?w); debug!(?w);
self.active_window = w.0; self.active_window = w.0;
let icon = lookup(&w.1) let class;
if &w.1 == "lw" {
class = "LibreWolf";
} else {
class = &w.1;
}
let icon = lookup(class)
.with_theme("Papirus-Dark") .with_theme("Papirus-Dark")
.force_svg() .force_svg()
.with_size(16) .with_size(16)
@ -361,7 +368,11 @@ impl Panel {
if let Some(handle) = &self.active_window_icon_svg { if let Some(handle) = &self.active_window_icon_svg {
icon = svg(handle.clone()).width(16).height(16).into(); icon = svg(handle.clone()).width(16).height(16).into();
} else { } else {
icon = image("/home/chris/pics/wojaks/reddit_the_xenomorph_s bigass wojak folder/Chads/ChristianChad.png").into(); if let Some(handle) = &self.active_window_icon_raster {
icon = image(handle.clone()).width(16).height(16).into();
} else {
icon = image("/home/chris/pics/wojaks/reddit_the_xenomorph_s bigass wojak folder/Chads/ChristianChad.png").width(16).height(16).into();
}
} }
let icon = container(icon).center(Length::Shrink).padding(4); let icon = container(icon).center(Length::Shrink).padding(4);
@ -433,6 +444,19 @@ impl Panel {
text_color: theme.palette().text, text_color: theme.palette().text,
} }
} }
async fn add_sys_tray(mut self) -> Self {
let sys_tray = SystemTray::new().await;
match sys_tray {
Ok(s) => {
self.system_tray = Some(s);
}
Err(e) => {
error!(?e, "Sys tray couldn't be initialized")
}
}
self
}
} }
pub fn convert(num: f64) -> String { pub fn convert(num: f64) -> String {