diff --git a/hyprman/Cargo.toml b/hyprman/Cargo.toml new file mode 100644 index 0000000..1e8d8bb --- /dev/null +++ b/hyprman/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "hyprman" +version = "0.1.0" +edition = "2024" + +[dependencies] diff --git a/hyprman/src/main.rs b/hyprman/src/main.rs new file mode 100644 index 0000000..2e4da0f --- /dev/null +++ b/hyprman/src/main.rs @@ -0,0 +1,15 @@ +use std::env; +use std::io::Read; +use std::os::unix::net::UnixStream; + +fn main() { + let mut socket2_path: String = env::var("XDG_RUNTIME_DIR").unwrap(); + socket2_path.push_str("/hypr/"); + socket2_path.push_str(&*env::var("HYPRLAND_INSTANCE_SIGNATURE").unwrap()); + socket2_path.push_str("/.socket2.sock"); + let mut stream = UnixStream::connect(socket2_path).unwrap(); + println!("Connected to socket2: {:?}", stream.local_addr()); + let mut line = String::new(); + stream.read_to_string(&mut line).unwrap(); + println!("{line}"); +}