From cb269f35135a17e0f6fafdbe3a3c61499a9d4445 Mon Sep 17 00:00:00 2001 From: cashmere Date: Sat, 25 Jul 2026 16:34:25 +0200 Subject: x11/awww/: add awww --- x11/awww/files/patch-daemon_src_wallpaper.rs | 63 ++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 x11/awww/files/patch-daemon_src_wallpaper.rs (limited to 'x11/awww/files/patch-daemon_src_wallpaper.rs') diff --git a/x11/awww/files/patch-daemon_src_wallpaper.rs b/x11/awww/files/patch-daemon_src_wallpaper.rs new file mode 100644 index 0000000..b24020b --- /dev/null +++ b/x11/awww/files/patch-daemon_src_wallpaper.rs @@ -0,0 +1,63 @@ +--- daemon/src/wallpaper.rs.orig 2026-04-25 17:08:32 UTC ++++ daemon/src/wallpaper.rs +@@ -312,25 +312,42 @@ impl Wallpaper { + cache.resize, cache.filter, cache.img_path + ); + common::log::debug!("{}", cmd); +- match unsafe { rustix::runtime::kernel_fork() } { +- Ok(rustix::runtime::Fork::Child(_)) => { +- let args: [*const u8; 4] = [ +- c"sh".as_ptr().cast(), +- c"-c".as_ptr().cast(), +- cmd.as_ptr(), +- core::ptr::null(), +- ]; +- let err = unsafe { +- rustix::runtime::execve( +- c"/bin/sh", +- args.as_ptr(), +- environ as *const _, +- ) +- }; +- panic!("execve failed: {err}"); ++ #[cfg(target_os = "linux")] ++ { ++ match unsafe { rustix::runtime::kernel_fork() } { ++ Ok(rustix::runtime::Fork::Child(_)) => { ++ let args: [*const u8; 4] = [ ++ c"sh".as_ptr().cast(), ++ c"-c".as_ptr().cast(), ++ cmd.as_ptr(), ++ core::ptr::null(), ++ ]; ++ let err = unsafe { ++ rustix::runtime::execve( ++ c"/bin/sh", ++ args.as_ptr(), ++ environ as *const _, ++ ) ++ }; ++ panic!("execve failed: {err}"); ++ } ++ Ok(rustix::runtime::Fork::ParentOf(_)) => (), ++ Err(e) => error!("fork failed: {e}"), + } +- Ok(rustix::runtime::Fork::ParentOf(_)) => (), +- Err(e) => error!("fork failed: {e}"), ++ } ++ #[cfg(not(target_os = "linux"))] ++ { ++ use std::process::Command; ++ ++ let cmd_str = cmd.trim_end_matches('\0'); ++ match Command::new("/bin/sh") ++ .arg("-c") ++ .arg(cmd_str) ++ .spawn() ++ { ++ Ok(_) => {} ++ Err(e) => error!("fork/exec failed: {e}"), ++ } + } + } + Ok(None) => break 'brk, -- cgit v1.3.1