diff --git a/src/gather.rs b/src/gather.rs index 48df415..e84baa2 100644 --- a/src/gather.rs +++ b/src/gather.rs @@ -52,7 +52,7 @@ pub fn gather_sessions(user: &User) -> Vec { true => gather_hm_sessions(&hm_profile), false => vec![Session { name: String::from("Shell"), - init: user.shell.clone(), + init: user.shell.to_str().unwrap().to_owned(), }], } } @@ -105,7 +105,11 @@ fn gather_session_data(path: &PathBuf) -> Session { let session_path = path.join("session"); let name = read_to_string(session_path.join("name")).unwrap(); - let init = session_path.join("init"); + let init = format!( + "{} && {}", + path.join("activate").display(), + session_path.join("init").display() + ); Session { name, init } } diff --git a/src/greetd.rs b/src/greetd.rs index d62a2e4..9dd8ec4 100644 --- a/src/greetd.rs +++ b/src/greetd.rs @@ -30,7 +30,7 @@ pub fn login( return Ok(LoginResult::Success); } else { starting = true; - let cmd = vec![session.init.to_str().unwrap().to_owned()]; + let cmd = vec![session.init.clone()]; let env = vec![]; Request::StartSession { cmd, env }.write_to(&mut stream)?; } diff --git a/src/main.rs b/src/main.rs index 806cb91..94f48af 100644 --- a/src/main.rs +++ b/src/main.rs @@ -111,7 +111,7 @@ impl Display for User { #[derive(PartialEq, Eq, Clone)] struct Session { name: String, - init: PathBuf, + init: String, } impl Display for Session { @@ -325,11 +325,12 @@ impl App { { LoginResult::Success => { self.error = false; - self.status = Status::Success + self.status = Status::Success; + self.exit = true; } LoginResult::Failure => { self.error = true; - self.status = Status::Error + self.status = Status::Error; } }; }