Pi66

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

← back to log

remove hyprpaper because its stupid

author: pixel2175
date: 2025-05-31 20:36
hash: b8fb3b2d8f8d2bc8e66230bdb7eea8d8334948bf

Diffstat:

M

Cargo.lock
2 -

M

src/wallpaper.rs
45 +-----------------------------
 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
diff --git a/Cargo.lock b/Cargo.lock
index 3c12878..c59528d 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1226,7 +1226,7 @@ checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"

 [[package]]
 name = "walrs"
-version = "1.1.0"
+version = "1.1.1"
 dependencies = [
  "argh",
  "color-thief",
diff --git a/src/wallpaper.rs b/src/wallpaper.rs
index 629d772..eecfb41 100644
--- a/src/wallpaper.rs
+++ b/src/wallpaper.rs
@@ -1,9 +1,8 @@
+use crate::utils::run;
 use crate::utils::{info, warning};
 use std::env;
 use std::path::Path;
 use std::process::{Command, Stdio};
-use crate::utils::run;
-

 fn run_with_output(command: &str) -> Option<String> {
     let output = Command::new("sh")
@@ -94,7 +93,7 @@ fn set_wm_wallpaper(img: &str, send: bool) {
         spawn(&format!("xwallpaper --zoom '{}'", img));
         info("Wallpaper", "wallpaper set with xwallpaper", send);
     } else if run("which feh") {
-   // I thought there was a problem, but there isn't.
+        // I thought there was a problem, but there isn't.
         spawn(&format!("feh --no-fehbg --bg-fill '{}'", img));
         info("Wallpaper", "wallpaper set with feh", send);
     } else if run("which hsetroot") {
@@ -184,48 +183,8 @@ fn set_desktop_wallpaper(desktop: &str, img: &str, send: bool) {
             abs_path
         ));
         info("Wallpaper", "wallpaper set with Cinnamon settings", send);
-    } else if d.contains("hyprland") {
-        // Get monitors using a more reliable approach
-        let monitors: Vec<String> =
-            run_with_output("hyprctl monitors | grep Monitor | cut -d' ' -f2")
-                .unwrap_or_default()
-                .lines()
-                .map(|s| s.trim().to_string())
-                .filter(|s| !s.is_empty())
-                .collect();
-
-        if !monitors.is_empty() {
-            // Create a new hyprpaper.conf file
-            let home = env::var("HOME").unwrap_or_else(|_| ".".to_string());
-            let config_path = format!("{}/.config/hypr/hyprpaper.conf", home);
-
-            // Write configuration as a single operation instead of multiple echo commands
-            let mut config = format!("preload = {}\n", abs_path);
-            for monitor in &monitors {
-                config.push_str(&format!("wallpaper = {},{}\n", monitor, abs_path));
-            }
-
-            // Use filesystem operations instead of echo
-            if let Err(e) = std::fs::write(&config_path, config) {
-                warning(
-                    "Wallpaper",
-                    &format!("failed to write hyprpaper config: {}", e),
-                    send,
-                );
-            } else {
-                // Restart hyprpaper
-                spawn("killall hyprpaper 2>/dev/null; hyprpaper &");
-                info("Wallpaper", "wallpaper set with hyprpaper", send);
-            }
-        } else {
-            // Fallback to swaybg if no monitors detected
-            spawn(&format!("pkill swaybg; swaybg -i '{}' -m fill &", abs_path));
-            info("Wallpaper", "wallpaper set with swaybg for Hyprland", send);
-        }
     } else if d == "sway" {
-        // Using swww or swaybg for Sway
         if run("which swww") {
-            // Initialize swww if not running
             if !run("pgrep -x swww-daemon") {
                 spawn("swww init");
             }