refact, option, allow linux headless

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2023-07-29 13:06:18 +08:00
parent 3c4852a254
commit c15e3c306e
5 changed files with 106 additions and 63 deletions

View File

@@ -109,6 +109,10 @@ pub fn try_start_desktop(_username: &str, _passsword: &str) -> String {
// No need to verify password here.
return "".to_owned();
}
if username.is_empty() {
// Another user is logged in. No need to start a new xsession.
return "".to_owned();
}
if let Some(msg) = detect_headless() {
return msg.to_owned();