chore: update dependencies

This commit is contained in:
Michael Aaron Murphy 2024-08-21 03:07:16 +02:00
parent 6948373a68
commit 3ec53d7f8a
No known key found for this signature in database
GPG key ID: B2732D4240C9212C
10 changed files with 350 additions and 304 deletions

View file

@ -6,10 +6,10 @@ license = "GPL-3.0"
[dependencies]
anyhow = "1.0"
ashpd = { version = "0.9", default-features = false }
ashpd = { version = "0.9", default-features = false, features = ["tokio"] }
async-channel = "2.3.1"
chrono = "0.4.38"
clap = { version = "4.5.11", features = ["derive"] }
clap = { version = "4.5.16", features = ["derive"] }
color-eyre = "0.6.3"
cosmic-bg-config.workspace = true
cosmic-comp-config.workspace = true
@ -25,48 +25,46 @@ derivative = "2.2.0"
derive_setters = "0.1.6"
dirs = "5.0.1"
downcast-rs = "1.2.1"
freedesktop-desktop-entry = "0.7.0"
freedesktop-desktop-entry = "0.7.3"
futures = "0.3.30"
generator = "=0.8.1"
hostname-validator = "1.1.1"
hostname1-zbus = { git = "https://github.com/pop-os/dbus-settings-bindings" }
timedate-zbus = { git = "https://github.com/pop-os/dbus-settings-bindings" }
i18n-embed-fl = "0.8.0"
i18n-embed-fl = "0.9.1"
image = "0.25"
indexmap = "2.4.0"
itertools = "0.13.0"
itoa = "1.0.11"
libcosmic.workspace = true
notify = "6.1.1"
once_cell = "1.19.0"
regex = "1.10.5"
regex = "1.10.6"
ron = "0.8"
rust-embed = "8.5.0"
serde = { version = "1.0.204", features = ["derive"] }
serde = { version = "1.0.208", features = ["derive"] }
slab = "0.4.9"
slotmap = "1.0.7"
static_init = "1.0.3"
sunrise = "1.0.1"
tachyonix = "0.3.0"
timedate-zbus = { git = "https://github.com/pop-os/dbus-settings-bindings" }
tokio.workspace = true
tracing = "0.1.40"
tracing-subscriber = "0.3.18"
udev = "0.9.0"
url = "2.5.2"
xkb-data = "0.1.0"
xkb-data = "0.2.1"
zbus = { version = "4.4.0", features = ["tokio"] }
tachyonix = "0.3.0"
slab = "0.4.9"
indexmap = "2.4.0"
[dependencies.cosmic-settings-subscriptions]
git = "https://github.com/pop-os/cosmic-settings-subscriptions"
# path = "../../cosmic-settings-subscriptions"
features = ["pipewire", "pulse"]
[dependencies.icu]
version = "1.4.0"
version = "1.5.0"
features = ["experimental", "compiled_data", "icu_datetime_experimental"]
[dependencies.i18n-embed]
version = "0.14.1"
version = "0.15.0"
features = ["fluent-system", "desktop-requester"]
[features]

View file

@ -6,7 +6,6 @@ use cosmic_settings_page::Entity;
pub mod desktop;
pub mod display;
pub mod input;
pub mod networking;
pub mod power;
pub mod sound;
pub mod system;

View file

@ -1,7 +1,7 @@
// Copyright 2023 System76 <info@system76.com>
// SPDX-License-Identifier: GPL-3.0-only
use std::time::Duration;
use std::{collections::BTreeMap, time::Duration};
use cosmic::{
widget::{self, settings},
@ -71,7 +71,7 @@ pub enum DeviceId {
pub struct Page {
pipewire_thread: Option<(tokio::sync::oneshot::Sender<()>, pipewire::Sender<()>)>,
pulse_thread: Option<tokio::sync::oneshot::Sender<()>>,
devices: IndexMap<DeviceId, Card>,
devices: BTreeMap<DeviceId, Card>,
card_names: IndexMap<DeviceId, String>,
card_profiles: IndexMap<DeviceId, Vec<pulse::CardProfile>>,
active_profiles: IndexMap<DeviceId, Option<String>>,
@ -451,7 +451,7 @@ impl Page {
}
if let Some(card_id) = remove {
_ = self.devices.shift_remove(&card_id);
_ = self.devices.remove(&card_id);
}
if let Some(pos) = self.sink_ids.iter().position(|&id| id == node_id) {

View file

@ -1,3 +1,7 @@
use std::future::Future;
use futures::{future::select, StreamExt};
/// Normalize the labeling of displays across settings pages.
pub fn display_name(name: &str, physical: (u32, u32)) -> String {
let inches = ((physical.0.pow(2) + physical.1.pow(2)) as f32).sqrt() * 0.039_370_1;
@ -15,3 +19,30 @@ pub fn display_name(name: &str, physical: (u32, u32)) -> String {
),
}
}
/// Spawn a background tasks and forward its messages
pub fn forward_event_loop<M: 'static + Send, T: Future<Output = ()> + Send + 'static>(
sender: tokio::sync::mpsc::Sender<crate::pages::Message>,
message_map: fn(M) -> crate::pages::Message,
event_loop: impl FnOnce(futures::channel::mpsc::Sender<M>) -> T + Send + 'static,
) -> tokio::sync::oneshot::Sender<()> {
let (cancel_tx, cancel_rx) = tokio::sync::oneshot::channel::<()>();
tokio::task::spawn(async move {
let (tx, mut rx) = futures::channel::mpsc::channel(1);
let cancel = std::pin::pin!(cancel_rx);
let forwarder = std::pin::pin!(async move {
while let Some(event) = rx.next().await {
if sender.send(message_map(event)).await.is_err() {
break;
}
}
});
select(cancel, select(forwarder, std::pin::pin!(event_loop(tx)))).await;
});
cancel_tx
}