fix: linux, window, workaround, mint, mate (#10146)

* refact: linux, window, workaround, mint, mate

Signed-off-by: fufesou <linlong1266@gmail.com>

* refact: case insensitive

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou
2024-12-03 01:02:41 +08:00
committed by GitHub
parent b8d36b6558
commit bd0a33e467
6 changed files with 161 additions and 17 deletions

View File

@@ -19,6 +19,7 @@ use hbb_common::allow_err;
use hbb_common::{
config::{self, LocalConfig, PeerConfig, PeerInfoSerde},
fs, lazy_static, log,
message_proto::Hash,
rendezvous_proto::ConnType,
ResultType,
};
@@ -2341,6 +2342,25 @@ pub fn main_audio_support_loopback() -> SyncReturn<bool> {
SyncReturn(is_surpport)
}
pub fn get_os_distro_info() -> SyncReturn<String> {
#[cfg(target_os = "linux")]
{
let distro = &hbb_common::platform::linux::DISTRO;
SyncReturn(
serde_json::to_string(&HashMap::from([
("name", distro.name.clone()),
("id", distro.id.clone()),
("version_id", distro.version_id.clone()),
]))
.unwrap_or_default(),
)
}
#[cfg(not(target_os = "linux"))]
{
SyncReturn("".to_owned())
}
}
#[cfg(target_os = "android")]
pub mod server_side {
use hbb_common::{config, log};