mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-03-26 14:41:04 +03:00
fix default video save directory
Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
@@ -20,6 +20,7 @@ use hbb_common::{bail, log};
|
||||
use include_dir::{include_dir, Dir};
|
||||
use objc::{class, msg_send, sel, sel_impl};
|
||||
use scrap::{libc::c_void, quartz::ffi::*};
|
||||
use std::path::PathBuf;
|
||||
|
||||
static PRIVILEGES_SCRIPTS_DIR: Dir =
|
||||
include_dir!("$CARGO_MANIFEST_DIR/src/platform/privileges_scripts");
|
||||
@@ -374,6 +375,17 @@ pub fn get_active_userid() -> String {
|
||||
get_active_user("-n")
|
||||
}
|
||||
|
||||
pub fn get_active_user_home() -> Option<PathBuf> {
|
||||
let username = get_active_username();
|
||||
if !username.is_empty() {
|
||||
let home = PathBuf::from(format!("/Users/{}", username));
|
||||
if home.exists() {
|
||||
return Some(home);
|
||||
}
|
||||
}
|
||||
None
|
||||
}
|
||||
|
||||
pub fn is_prelogin() -> bool {
|
||||
get_active_userid() == "0"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user