-
Notifications
You must be signed in to change notification settings - Fork 73
Open
Description
Commands sent to hyprpaper IPC hang for me because the stream.read_to_end functions in instance.rs wait for an EOF that is never sent by the socket.
For example, I couldn't get this to write anything
match hyprpaper(Keyword::ListActive) {
Ok(response) => match response {
Response::ActiveWallpapers(wallpapers) => {
for wallpaper in wallpapers {
println!("active wallpaper: {}", wallpaper.wallpaper_path);
}
}
_ => println!("Unexpected response!"),
},
Err(e) => println!("Error: {e}"),
}
Using something like this in instance.rs fixed it for me
use std::io::{Read, Write};
let mut stream = std::os::unix::net::UnixStream::connect(&self.hyprpaper_stream)?;
stream.write_all(content.data.as_bytes())?;
let mut buffer = [0u8; 8192];
let n = stream.read(&mut buffer[..])?;
let response = String::from_utf8(buffer[..n].to_vec())?;
Ok(response)
Metadata
Metadata
Assignees
Labels
No labels