initial testing started
This commit is contained in:
6
hyprman/Cargo.toml
Normal file
6
hyprman/Cargo.toml
Normal file
@@ -0,0 +1,6 @@
|
||||
[package]
|
||||
name = "hyprman"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
15
hyprman/src/main.rs
Normal file
15
hyprman/src/main.rs
Normal 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}");
|
||||
}
|
Reference in New Issue
Block a user