mod client;
mod control;
mod protocol;
mod server;
use std::path::PathBuf;
pub use client::{DaemonClient, DaemonShellRuntime};
pub use control::ControlServer;
pub use protocol::{
HelloResult, JournalRead, SessionInfo, MAX_FRAME_BYTES, PROTOCOL_MAJOR, PROTOCOL_MINOR,
};
pub use server::DaemonServer;
pub fn default_socket_path() -> PathBuf {
if let Some(path) = std::env::var_os("WINX_SOCKET") {
return PathBuf::from(path);
}
if let Some(runtime_dir) = std::env::var_os("XDG_RUNTIME_DIR") {
return PathBuf::from(runtime_dir).join("winx/winxd.sock");
}
PathBuf::from(format!("/tmp/winx-{}/winxd.sock", unsafe { libc::geteuid() }))
}