initial testing started

This commit is contained in:
2025-02-27 22:21:02 +01:00
parent 16ce7cfb17
commit 36c2a6d445
2 changed files with 21 additions and 0 deletions

6
hyprman/Cargo.toml Normal file
View File

@@ -0,0 +1,6 @@
[package]
name = "hyprman"
version = "0.1.0"
edition = "2024"
[dependencies]

15
hyprman/src/main.rs Normal file
View File

@@ -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}");
}