Pi66

walrs
pywal but if its Fast-Minimal-Simple
git clone https://git.pi66.xyz/walrs

← back to log

fix some feh glitches in void

author: pixel2175
date: 2025-05-08 00:52
hash: 9c5d2c2b96049033b588b1b3d39a194998c87323

Diffstat:

M

src/wallpaper.rs
19 ++++++++----------------------
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
diff --git a/src/wallpaper.rs b/src/wallpaper.rs
index 383901c..f8217ca 100644
--- a/src/wallpaper.rs
+++ b/src/wallpaper.rs
@@ -2,17 +2,8 @@ use crate::utils::{info, warning};
 use std::env;
 use std::path::Path;
 use std::process::{Command, Stdio};
+use crate::utils::run;

-fn run(command: &str) -> bool {
-    Command::new("sh")
-        .arg("-c")
-        .arg(command)
-        .stdout(Stdio::null())
-        .stderr(Stdio::null())
-        .status()
-        .map(|s| s.success())
-        .unwrap_or(false)
-}

 fn run_with_output(command: &str) -> Option<String> {
     let output = Command::new("sh")
@@ -99,12 +90,12 @@ fn get_desktop_env() -> Option<String> {
 }

 fn set_wm_wallpaper(img: &str, send: bool) {
-    if run("which feh") {
-        spawn(&format!("feh --no-fehbg --bg-fill '{}'", img));
-        info("Wallpaper", "wallpaper set with feh", send);
-    } else if run("which xwallpaper") {
+    if run("which xwallpaper") {
         spawn(&format!("xwallpaper --zoom '{}'", img));
         info("Wallpaper", "wallpaper set with xwallpaper", send);
+    } else if run("which feh") {
+        spawn(&format!("feh --no-fehbg --bg-fill '{}'", img));
+        info("Wallpaper", "wallpaper set with feh", send);
     } else if run("which hsetroot") {
         spawn(&format!("hsetroot -fill '{}'", img));
         info("Wallpaper", "wallpaper set with hsetroot", send);