Get hyprland session at runtime
All checks were successful
/ release (push) Successful in 1m29s

This commit is contained in:
Benjamyn Love 2025-07-02 11:10:23 +10:00
parent 997508cedf
commit 636197baab

View File

@ -2,8 +2,15 @@ use std::fmt::Write as _;
use crate::lib::ipc;
use crate::Wallpapers;
use std::env;
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() {
let mut buf = String::new();