comp: Allow to specify different compositors
This commit is contained in:
parent
342369eaf9
commit
c44946be82
2 changed files with 10 additions and 4 deletions
|
|
@ -173,6 +173,8 @@ async fn send_fd(session_tx: &mut OwnedWriteHalf, stream: Vec<UnixStream>) -> Re
|
|||
|
||||
pub fn run_compositor(
|
||||
process_manager: &ProcessManager,
|
||||
exec: String,
|
||||
args: Vec<String>,
|
||||
_token: CancellationToken,
|
||||
mut socket_rx: mpsc::UnboundedReceiver<Vec<UnixStream>>,
|
||||
env_tx: oneshot::Sender<HashMap<String, String>>,
|
||||
|
|
@ -200,7 +202,8 @@ pub fn run_compositor(
|
|||
process_manager
|
||||
.start_process(
|
||||
Process::new()
|
||||
.with_executable("cosmic-comp")
|
||||
.with_executable(exec)
|
||||
.with_args(args)
|
||||
.with_env([("COSMIC_SESSION_SOCK", comp.as_raw_fd().to_string())])
|
||||
.with_on_exit(move |pman, _, err_code, _will_restart| {
|
||||
let session_dbus_tx = session_dbus_tx.clone();
|
||||
|
|
|
|||
|
|
@ -9,9 +9,7 @@ mod service;
|
|||
mod systemd;
|
||||
|
||||
use std::{
|
||||
borrow::Cow,
|
||||
os::fd::{AsRawFd, OwnedFd},
|
||||
sync::Arc,
|
||||
borrow::Cow, env, os::fd::{AsRawFd, OwnedFd}, sync::Arc
|
||||
};
|
||||
|
||||
use async_signals::Signals;
|
||||
|
|
@ -116,6 +114,9 @@ async fn start(
|
|||
) -> Result<Status> {
|
||||
info!("Starting cosmic-session");
|
||||
|
||||
let mut args = env::args().skip(1);
|
||||
let (executable, args) = (args.next().unwrap_or_else(|| String::from("cosmic-comp")), args.collect::<Vec<_>>());
|
||||
|
||||
let process_manager = ProcessManager::new().await;
|
||||
_ = process_manager.set_max_restarts(usize::MAX).await;
|
||||
_ = process_manager
|
||||
|
|
@ -128,6 +129,8 @@ async fn start(
|
|||
let (env_tx, env_rx) = oneshot::channel();
|
||||
let compositor_handle = comp::run_compositor(
|
||||
&process_manager,
|
||||
executable.clone(),
|
||||
args,
|
||||
token.child_token(),
|
||||
socket_rx,
|
||||
env_tx,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue