mirror of
https://github.com/rustdesk/rustdesk
synced 2026-05-24 09:28:23 +00:00
commit
eec17579f1
1 changed files with 9 additions and 0 deletions
|
|
@ -43,6 +43,10 @@ fn get_display_server_of_session(session: &str) -> String {
|
|||
display_server
|
||||
}
|
||||
} else {
|
||||
// loginctl has not given the expected output. try something else.
|
||||
if let Ok(sestype) = std::env::var("XDG_SESSION_TYPE") {
|
||||
return sestype.to_owned();
|
||||
}
|
||||
// If the session is not a tty, then just return the type as usual
|
||||
display_server
|
||||
}
|
||||
|
|
@ -80,6 +84,11 @@ pub fn get_value_of_seat0(i: usize) -> String {
|
|||
}
|
||||
}
|
||||
|
||||
// loginctl has not given the expected output. try something else.
|
||||
if let Ok(sid) = std::env::var("XDG_SESSION_ID") { // could also execute "cat /proc/self/sessionid"
|
||||
return sid.to_owned();
|
||||
}
|
||||
|
||||
return "".to_owned();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue