chore: update dependencies
Removes the `cosmic-notifications-utils` dependency, and instead defines the notification FDs here (since they're unlikely to change).
This commit is contained in:
parent
a77aaa1904
commit
673e4c949b
4 changed files with 464 additions and 807 deletions
1233
Cargo.lock
generated
1233
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -15,7 +15,6 @@ cosmic-dbus-a11y = { git = "https://github.com/pop-os/dbus-settings-bindings" }
|
|||
freedesktop-desktop-entry = { version = "0.8", optional = true }
|
||||
shell-words = { version = "1.1.1", optional = true }
|
||||
dirs = { version = "6.0.0", optional = true }
|
||||
itertools = "0.14"
|
||||
launch-pad = { git = "https://github.com/pop-os/launch-pad" }
|
||||
log-panics = { version = "2", features = ["with-backtrace"] }
|
||||
rustix = "1.1"
|
||||
|
|
@ -43,7 +42,6 @@ tracing = "0.1"
|
|||
tracing-journald = { version = "0.3", optional = true }
|
||||
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
||||
zbus = { version = "5.14.0", default-features = false, features = ["tokio"] }
|
||||
cosmic-notifications-util = { git = "https://github.com/pop-os/cosmic-notifications" }
|
||||
logind-zbus = { version = "5.3.2", optional = true }
|
||||
|
||||
[features]
|
||||
|
|
|
|||
32
src/main.rs
32
src/main.rs
|
|
@ -10,9 +10,6 @@ mod service;
|
|||
mod systemd;
|
||||
|
||||
use color_eyre::{Result, eyre::WrapErr};
|
||||
use cosmic_notifications_util::{DAEMON_NOTIFICATIONS_FD, PANEL_NOTIFICATIONS_FD};
|
||||
#[cfg(feature = "autostart")]
|
||||
use itertools::Itertools;
|
||||
use launch_pad::{ProcessManager, process::Process};
|
||||
use service::SessionRequest;
|
||||
#[cfg(feature = "autostart")]
|
||||
|
|
@ -37,7 +34,9 @@ use tokio_util::sync::CancellationToken;
|
|||
use tracing::{Instrument, metadata::LevelFilter};
|
||||
use tracing_subscriber::{EnvFilter, fmt, prelude::*};
|
||||
|
||||
use crate::notifications::notifications_process;
|
||||
use crate::notifications::{
|
||||
DAEMON_NOTIFICATIONS_FD, PANEL_NOTIFICATIONS_FD, notifications_process,
|
||||
};
|
||||
#[cfg(feature = "autostart")]
|
||||
const AUTOSTART_DIR: &'static str = "autostart";
|
||||
#[cfg(feature = "autostart")]
|
||||
|
|
@ -243,10 +242,9 @@ async fn start(
|
|||
.instrument(stderr_span)
|
||||
})
|
||||
.with_on_exit(move |_, _, _, will_restart| {
|
||||
if !will_restart
|
||||
&& let Some(tx) = settings_exit_tx.lock().unwrap().take() {
|
||||
_ = tx.send(());
|
||||
}
|
||||
if !will_restart && let Some(tx) = settings_exit_tx.lock().unwrap().take() {
|
||||
_ = tx.send(());
|
||||
}
|
||||
async {}
|
||||
}),
|
||||
)
|
||||
|
|
@ -413,7 +411,9 @@ async fn start(
|
|||
|
||||
if let Some(program_name) = exec_words.next() {
|
||||
// filter out any placeholder args, since we might not be able to deal with them
|
||||
let filtered_args = exec_words.filter(|s| !s.starts_with("%")).collect_vec();
|
||||
let filtered_args = exec_words
|
||||
.filter(|s| !s.starts_with("%"))
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
// escape them
|
||||
let escaped_args = shell_words::split(&*filtered_args.join(" "));
|
||||
|
|
@ -534,13 +534,13 @@ async fn start_component(
|
|||
#[cfg(feature = "systemd")]
|
||||
if *is_systemd_used()
|
||||
&& let Ok((innr_cmd, Some(pid))) = pman.get_exe_and_pid(pkey).await
|
||||
&& let Err(err) = spawn_scope(innr_cmd.clone(), vec![pid]).await {
|
||||
warn!(
|
||||
"Failed to spawn scope for {}. Creating transient unit failed \
|
||||
with {}",
|
||||
innr_cmd, err
|
||||
);
|
||||
};
|
||||
&& let Err(err) = spawn_scope(innr_cmd.clone(), vec![pid]).await
|
||||
{
|
||||
warn!(
|
||||
"Failed to spawn scope for {}. Creating transient unit failed with {}",
|
||||
innr_cmd, err
|
||||
);
|
||||
};
|
||||
})
|
||||
.with_on_exit(move |mut _pman, _key, err_code, _will_restart| {
|
||||
if let Some(err) = err_code {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
use color_eyre::{Result, eyre::Context};
|
||||
use cosmic_notifications_util::{DAEMON_NOTIFICATIONS_FD, PANEL_NOTIFICATIONS_FD};
|
||||
use launch_pad::{ProcessKey, process::Process};
|
||||
use rustix::fd::AsRawFd;
|
||||
use std::{
|
||||
|
|
@ -9,6 +8,9 @@ use std::{
|
|||
use tokio::sync::Mutex;
|
||||
use tracing::Instrument;
|
||||
|
||||
pub const PANEL_NOTIFICATIONS_FD: &str = "PANEL_NOTIFICATIONS_FD";
|
||||
pub const DAEMON_NOTIFICATIONS_FD: &str = "DAEMON_NOTIFICATIONS_FD";
|
||||
|
||||
pub fn create_socket() -> Result<(OwnedFd, OwnedFd)> {
|
||||
// Create a new pair of unnamed Unix sockets
|
||||
let (sock_1, sock_2) = UnixStream::pair().wrap_err("failed to create socket pair")?;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue