diff options
| author | cashmere <cashmere1337@riseup.net> | 2026-10-23 12:08:32 +0200 |
|---|---|---|
| committer | cashmere <cashmere1337@riseup.net> | 2026-10-23 12:08:32 +0200 |
| commit | edd7d36cdc6f6e4be6d2b1e78ce8fd5b66485b92 (patch) | |
| tree | 7e510ebd2ea83ea14846a2bde62e724b296acb67 /src/icon.rs | |
| parent | 4901b5d77d73db59f0c1545719ec6d1404aad979 (diff) | |
| download | i3bar-mango-edd7d36cdc6f6e4be6d2b1e78ce8fd5b66485b92.tar.gz | |
Diffstat (limited to 'src/icon.rs')
| -rw-r--r-- | src/icon.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/icon.rs b/src/icon.rs index 1173629..a9b9769 100644 --- a/src/icon.rs +++ b/src/icon.rs @@ -49,6 +49,13 @@ fn resolve_tray_icon(name: &str, theme_path: &str, bar_height: u32) -> Option<ca fn resolve_icon(app_id: &str, bar_height: u32) -> Option<cairo::ImageSurface> { let mut candidates = vec![app_id.to_string()]; + + if std::path::Path::new(app_id).is_file() + && let Ok(mut file) = std::fs::File::open(app_id) + && let Ok(surface) = cairo::ImageSurface::create_from_png(&mut file) + { + return Some(surface); + } if let Some(desktop_icon) = desktop_file_icon(app_id) && !candidates.contains(&desktop_icon) { |
