From 36c2a6d445082e3982a9373c90f98e7256ea8734 Mon Sep 17 00:00:00 2001 From: mpuchstein Date: Thu, 27 Feb 2025 22:21:02 +0100 Subject: [PATCH] initial testing started --- hyprman/Cargo.toml | 6 ++++++ hyprman/src/main.rs | 15 +++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 hyprman/Cargo.toml create mode 100644 hyprman/src/main.rs 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}"); +}