diff --git a/Cargo.lock b/Cargo.lock index 10ec5a9..f3012d1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1675,9 +1675,9 @@ dependencies = [ [[package]] name = "iced_layershell" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b68876658e12bc9df3c7dd2c315035e63645e94130bd4df8c3715918ab3f2a" +checksum = "f8b229ba826cb0eb36c5e70b75de0d6624f283abefd0c4394dffe02547fea1d1" dependencies = [ "futures", "iced", @@ -1688,8 +1688,10 @@ dependencies = [ "iced_runtime", "iced_style", "layershellev", + "log", "thiserror", "tracing", + "window_clipboard", ] [[package]] @@ -1988,9 +1990,9 @@ dependencies = [ [[package]] name = "layershellev" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b59faa1cb54d71d1578cb7df40026ebe49537619952d54a1d6cfb14a2ec59817" +checksum = "12591cf9def8038a7f7144daad28821ab591f735d7938906d5e2b38e91a17c53" dependencies = [ "bitflags 2.6.0", "log", @@ -3961,9 +3963,9 @@ dependencies = [ [[package]] name = "waycrate_xkbkeycode" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3d737dc0389ada40c18988224a6dea4f344fbb35a00be00940d8a2cf80bc8c6" +checksum = "33dff363c7d3e4907c199ac092e66e6d4f7129a526aa8cbc41ef22a50d3af098" dependencies = [ "bitflags 2.6.0", "log", diff --git a/lala_bar/Cargo.toml b/lala_bar/Cargo.toml index f1110c5..246295d 100644 --- a/lala_bar/Cargo.toml +++ b/lala_bar/Cargo.toml @@ -21,7 +21,7 @@ iced = { version = "0.12", features = [ ] } #iced_native = "0.12" iced_runtime = "0.12" -iced_layershell = "0.5.1" +iced_layershell = "0.6.0" tokio = { version = "1.40", features = ["full"] } iced_futures = "0.12.0" env_logger = "0.11.5" diff --git a/lala_bar/src/main.rs b/lala_bar/src/main.rs index ecce88f..db89a19 100644 --- a/lala_bar/src/main.rs +++ b/lala_bar/src/main.rs @@ -424,16 +424,23 @@ impl LalaMusicBar { let mut view_elements: Vec> = vec![]; if let Some(data) = &self.service_data { - if let Some(art_url) = url::Url::parse(&data.metadata.mpris_arturl) + let art_url_str = &data.metadata.mpris_arturl; + if let Some(art_url) = url::Url::parse(art_url_str) .ok() .and_then(|url| url.to_file_path().ok()) { - view_elements.push( - container(image(image::Handle::from_path(art_url)).width(Length::Fill)) - .padding(10) - .width(Length::Fill) - .into(), - ); + // HACK: not render soem thing like "/tmp/.org.chromium.Chromium.hYbnBf" + if art_url_str.ends_with("png") + || art_url_str.ends_with("jpeg") + || art_url_str.ends_with("jpg") + { + view_elements.push( + container(image(image::Handle::from_path(art_url)).width(Length::Fill)) + .padding(10) + .width(Length::Fill) + .into(), + ); + } view_elements.push(Space::with_height(10.).into()); view_elements.push( container( @@ -542,7 +549,17 @@ impl LalaMusicBar { let art_url = self .service_data .as_ref() - .and_then(|data| url::Url::parse(&data.metadata.mpris_arturl).ok()) + .and_then(|data| { + let art_url_str = &data.metadata.mpris_arturl; + // HACK: not render soem thing like "/tmp/.org.chromium.Chromium.hYbnBf" + if !art_url_str.ends_with("png") + && !art_url_str.ends_with("jpeg") + && !art_url_str.ends_with("jpg") + { + return None; + } + url::Url::parse(art_url_str).ok() + }) .and_then(|url| url.to_file_path().ok()); let title = container( text(title)