chore: cleanup
This commit is contained in:
parent
06b46f455b
commit
be0742f209
1 changed files with 3 additions and 38 deletions
|
|
@ -24,24 +24,12 @@ pub fn desktop_settings() -> iced_futures::Subscription<Desktop> {
|
||||||
|
|
||||||
match settings.color_scheme().await {
|
match settings.color_scheme().await {
|
||||||
Ok(color_scheme) => {
|
Ok(color_scheme) => {
|
||||||
dbg!(color_scheme);
|
|
||||||
let _ = tx.send(Desktop::ColorScheme(color_scheme)).await;
|
let _ = tx.send(Desktop::ColorScheme(color_scheme)).await;
|
||||||
}
|
}
|
||||||
Err(err) => error!("Failed to get the color scheme {err:?}"),
|
Err(err) => error!("Failed to get the color scheme {err:?}"),
|
||||||
};
|
};
|
||||||
// match settings
|
|
||||||
// .read::<ashpd::zvariant::OwnedValue>("org.freedesktop.appearance", "accent-color")
|
|
||||||
// .await
|
|
||||||
// {
|
|
||||||
// Ok(accent_color) => {
|
|
||||||
// dbg!(&accent_color);
|
|
||||||
// // let _ = tx.send(Desktop::Accent(accent_color)).await;
|
|
||||||
// }
|
|
||||||
// Err(err) => error!("Failed to get the accent color {err:?}"),
|
|
||||||
// };
|
|
||||||
match settings.contrast().await {
|
match settings.contrast().await {
|
||||||
Ok(contrast) => {
|
Ok(contrast) => {
|
||||||
dbg!(contrast);
|
|
||||||
let _ = tx.send(Desktop::Contrast(contrast)).await;
|
let _ = tx.send(Desktop::Contrast(contrast)).await;
|
||||||
}
|
}
|
||||||
Err(err) => error!("Failed to get the contrast {err:?}"),
|
Err(err) => error!("Failed to get the contrast {err:?}"),
|
||||||
|
|
@ -51,18 +39,7 @@ pub fn desktop_settings() -> iced_futures::Subscription<Desktop> {
|
||||||
if color_scheme_stream.is_none() {
|
if color_scheme_stream.is_none() {
|
||||||
error!("Failed to receive color scheme changes");
|
error!("Failed to receive color scheme changes");
|
||||||
}
|
}
|
||||||
// Item type is wrong in this version
|
|
||||||
// updating requires updating to zbus 4
|
|
||||||
let mut accent_stream = settings
|
|
||||||
.receive_setting_changed_with_args::<Color>(
|
|
||||||
"org.freedesktop.appearance",
|
|
||||||
"accent-color",
|
|
||||||
)
|
|
||||||
.await
|
|
||||||
.ok();
|
|
||||||
if accent_stream.is_none() {
|
|
||||||
error!("Failed to receive accent color changes");
|
|
||||||
}
|
|
||||||
let mut contrast_stream = settings.receive_contrast_changed().await.ok();
|
let mut contrast_stream = settings.receive_contrast_changed().await.ok();
|
||||||
if contrast_stream.is_none() {
|
if contrast_stream.is_none() {
|
||||||
error!("Failed to receive contrast changes");
|
error!("Failed to receive contrast changes");
|
||||||
|
|
@ -75,12 +52,7 @@ pub fn desktop_settings() -> iced_futures::Subscription<Desktop> {
|
||||||
}
|
}
|
||||||
futures::future::pending().await
|
futures::future::pending().await
|
||||||
};
|
};
|
||||||
// let next_accent = async {
|
|
||||||
// if let Some(s) = accent_stream.as_mut() {
|
|
||||||
// return s.next().await.and_then(std::result::Result::ok);
|
|
||||||
// }
|
|
||||||
// futures::future::pending().await
|
|
||||||
// };
|
|
||||||
let next_contrast = async {
|
let next_contrast = async {
|
||||||
if let Some(s) = contrast_stream.as_mut() {
|
if let Some(s) = contrast_stream.as_mut() {
|
||||||
return s.next().await;
|
return s.next().await;
|
||||||
|
|
@ -96,14 +68,7 @@ pub fn desktop_settings() -> iced_futures::Subscription<Desktop> {
|
||||||
color_scheme_stream = None;
|
color_scheme_stream = None;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// a = next_accent.fuse() => {
|
|
||||||
// dbg!(a);
|
|
||||||
// if let Some(a) = a {
|
|
||||||
// _ = tx.send(Desktop::Accent(a)).await;
|
|
||||||
// } else {
|
|
||||||
// accent_stream = None;
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
c = next_contrast.fuse() => {
|
c = next_contrast.fuse() => {
|
||||||
if let Some(c) = c {
|
if let Some(c) = c {
|
||||||
_ = tx.send(Desktop::Contrast(c)).await;
|
_ = tx.send(Desktop::Contrast(c)).await;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue