adding aider to gitignore and fixing padding
This commit is contained in:
parent
81c42943aa
commit
eb83bb3c38
2 changed files with 47 additions and 22 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,2 +1,3 @@
|
|||
target/
|
||||
.direnv/
|
||||
.aider*
|
||||
|
|
38
src/main.rs
38
src/main.rs
|
@ -126,8 +126,7 @@ impl Panel {
|
|||
None
|
||||
}
|
||||
};
|
||||
(
|
||||
Self {
|
||||
let mut app = Self {
|
||||
system: System::new_all(),
|
||||
disks: Disks::new_with_refreshed_list(),
|
||||
workspaces: workspaces.unwrap().to_vec(),
|
||||
|
@ -142,9 +141,11 @@ impl Panel {
|
|||
active_window_icon_raster,
|
||||
battery,
|
||||
system_tray: None,
|
||||
},
|
||||
Task::none(),
|
||||
)
|
||||
};
|
||||
|
||||
// let sys_task = Task::perform(app.add_sys_tray(), |app| app = app );
|
||||
|
||||
(app, Task::none())
|
||||
}
|
||||
fn namespace(&self) -> String {
|
||||
String::from("panel")
|
||||
|
@ -204,7 +205,13 @@ impl Panel {
|
|||
Message::ActiveWindowChange(w) => {
|
||||
debug!(?w);
|
||||
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")
|
||||
.force_svg()
|
||||
.with_size(16)
|
||||
|
@ -361,7 +368,11 @@ impl Panel {
|
|||
if let Some(handle) = &self.active_window_icon_svg {
|
||||
icon = svg(handle.clone()).width(16).height(16).into();
|
||||
} 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);
|
||||
|
||||
|
@ -433,6 +444,19 @@ impl Panel {
|
|||
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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue