WIP: feat/hyprpaper-support #2

Draft
benjamyn wants to merge 4 commits from feat/hyprpaper-support into master
Showing only changes of commit 636197baab - Show all commits

View File

@ -2,8 +2,15 @@ use std::fmt::Write as _;
use crate::lib::ipc; use crate::lib::ipc;
use crate::Wallpapers; use crate::Wallpapers;
use std::env;
pub fn change_wallpapers(wallpapers: &Wallpapers) { pub fn change_wallpapers(wallpapers: &Wallpapers) {
let ipc = ipc::IPC::new(String::from("/run/user/1000/hypr/9958d297641b5c84dcff93f9039d80a5ad37ab00_1751412591_2000702590/.hyprpaper.sock")); let hypr_session = env::var("HYPRLAND_INSTANCE_SIGNATURE").unwrap();
let xdg_path = env::var("XDG_RUNTIME_DIR").unwrap();
let mut socket_path = String::new();
write!(&mut socket_path, "{}/hypr/{}/.hyprpaper.sock", xdg_path, hypr_session).unwrap();
let ipc = ipc::IPC::new(socket_path);
for monitor in wallpapers.config.monitors.monitors.iter() { for monitor in wallpapers.config.monitors.monitors.iter() {
let mut buf = String::new(); let mut buf = String::new();