pub mod autostart;
pub mod clipboard;
mod display;
pub use display::physical_size_mm;
pub mod fs;
pub mod input;
pub mod local_socket;
pub mod notify;
pub mod permissions;
#[must_use]
pub fn host_name() -> Option<String> {
let name = os_host_name()?;
let name: String = name
.chars()
.take(a7n_proto::limits::PEER_NAME_MAX)
.collect();
(!name.is_empty()).then_some(name)
}
#[cfg(unix)]
fn os_host_name() -> Option<String> {
rustix::system::uname()
.nodename()
.to_str()
.ok()
.map(str::to_owned)
}
#[cfg(windows)]
fn os_host_name() -> Option<String> {
std::env::var("COMPUTERNAME").ok()
}
#[cfg(feature = "tray")]
pub mod tray;
#[must_use]
pub const fn platform() -> a7n_proto::v1::Platform {
use a7n_proto::v1::Platform;
if cfg!(target_os = "macos") {
Platform::Macos
} else if cfg!(target_os = "windows") {
Platform::Windows
} else if cfg!(target_os = "linux") {
Platform::Linux
} else {
Platform::Unspecified
}
}
pub mod transfer_fs;
mod network;
pub use network::{hw_addr_for, ipv4_broadcasts, local_addr_for};