headless, linux, debug
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
parent
d82d2471d7
commit
d86ef4a86e
@ -61,7 +61,9 @@ pub fn is_desktop_wayland() -> bool {
|
|||||||
const INVALID_SESSION: &str = "4294967295";
|
const INVALID_SESSION: &str = "4294967295";
|
||||||
|
|
||||||
pub fn get_user_and_display_server() -> (String, String) {
|
pub fn get_user_and_display_server() -> (String, String) {
|
||||||
let mut session = get_values_of_seat0(&[0])[0].clone();
|
let seat0_values = get_values_of_seat0(&[0, 2]);
|
||||||
|
let mut session = seat0_values[0].clone();
|
||||||
|
let username = seat0_values[1].clone();
|
||||||
if session.is_empty() {
|
if session.is_empty() {
|
||||||
// loginctl has not given the expected output. try something else.
|
// loginctl has not given the expected output. try something else.
|
||||||
if let Ok(sid) = std::env::var("XDG_SESSION_ID") {
|
if let Ok(sid) = std::env::var("XDG_SESSION_ID") {
|
||||||
@ -85,7 +87,7 @@ pub fn get_user_and_display_server() -> (String, String) {
|
|||||||
} else {
|
} else {
|
||||||
get_display_server_of_session(&session)
|
get_display_server_of_session(&session)
|
||||||
};
|
};
|
||||||
(session, display_server)
|
(username, display_server)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_display_server_of_session(session: &str) -> String {
|
pub fn get_display_server_of_session(session: &str) -> String {
|
||||||
|
@ -464,6 +464,7 @@ pub fn get_env_var(k: &str) -> String {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Headless is enabled, no need to wait prelogin.
|
||||||
pub fn is_prelogin() -> bool {
|
pub fn is_prelogin() -> bool {
|
||||||
let n = get_active_userid().len();
|
let n = get_active_userid().len();
|
||||||
n < 4 && n > 1
|
n < 4 && n > 1
|
||||||
|
@ -450,6 +450,8 @@ fn run(sp: GenericService) -> ResultType<()> {
|
|||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
ensure_close_virtual_device()?;
|
ensure_close_virtual_device()?;
|
||||||
|
|
||||||
|
println!("REMOVE ME ================================= run 111");
|
||||||
|
|
||||||
// ensure_inited() is needed because release_resource() may be called.
|
// ensure_inited() is needed because release_resource() may be called.
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
super::wayland::ensure_inited()?;
|
super::wayland::ensure_inited()?;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user