Generation is now activated before handing back control to greetd
This commit is contained in:
parent
4b5f812e95
commit
9d97505e02
|
@ -1,4 +1,4 @@
|
|||
use std::{env, error::Error, os::unix::net::UnixStream};
|
||||
use std::{env, error::Error, os::unix::net::UnixStream, process::Command};
|
||||
|
||||
use greetd_ipc::{codec::SyncCodec, AuthMessageType, ErrorType, Request, Response};
|
||||
|
||||
|
@ -36,6 +36,15 @@ pub fn login(
|
|||
session.generation.clone()
|
||||
)];
|
||||
env.append(&mut session.env.clone());
|
||||
|
||||
// Activate the generation before handing control back to greetd
|
||||
Command::new(format!(
|
||||
"su -c \"{}/activate\" {}",
|
||||
session.generation, user.name
|
||||
))
|
||||
.status()
|
||||
.expect("Failed to activate environment");
|
||||
|
||||
Request::StartSession { cmd, env }.write_to(&mut stream)?;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,9 +20,10 @@ pub fn handle_session() -> io::Result<()> {
|
|||
fn handle_hm_session() {
|
||||
println!(">>> Activating environment <<<");
|
||||
let generation = env::var("NIXGREETY_GENERATION").unwrap();
|
||||
Command::new(format!("{}/activate", generation))
|
||||
.status()
|
||||
.expect("Failed to activate environment");
|
||||
// Activating the generation is now handled before handing control back to greetd
|
||||
// Command::new(format!("{}/activate", generation))
|
||||
// .status()
|
||||
// .expect("Failed to activate environment");
|
||||
|
||||
println!(">>> Creating session <<<");
|
||||
Command::new(format!("{}/session/init", generation))
|
||||
|
|
Loading…
Reference in New Issue