tmp commit

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou committed 2023-04-03 13:16:53 +08:00
1 parent 9448e35b46
commit 3fd1da05f4
6 files changed
+92 -12

No files matched your search

+9
View File
@@ -80,6 +80,15 @@ pub fn try_start_x_session(username: &str, password: &str) -> ResultType<(String
}
}
#[inline]
pub fn is_headless() -> bool {
DESKTOP_MANAGER
.lock()
.unwrap()
.as_ref()
.map_or(false, |manager| manager.x11_username.is_empty())
}
pub fn get_username() -> String {
match &*DESKTOP_MANAGER.lock().unwrap() {
Some(manager) => {