gardesk/gardm / 784a0fd

Browse files

Try multiple wallpaper paths before using default

Check common wallpaper locations in order before falling
back to the hardcoded default path.
Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
784a0fd66dccd1a8dadb48c4ee77ce42886bd6f8
Parents
d3fd134
Tree
875c5b0

1 changed file

StatusFile+-
M gardm-greeter/src/config.rs 11 0
gardm-greeter/src/config.rsmodified
@@ -88,6 +88,17 @@ fn default_true() -> bool {
8888
     true
8989
 }
9090
 fn default_fallback() -> String {
91
+    // Try common locations for a default wallpaper
92
+    let candidates = [
93
+        "/home/mfwolffe/Pictures/background/cold/a_snowy_mountain_with_clouds_above.jpg",
94
+        "/usr/share/backgrounds/default.png",
95
+        "/usr/share/gardm/backgrounds/default.jpg",
96
+    ];
97
+    for path in candidates {
98
+        if std::path::Path::new(path).exists() {
99
+            return path.to_string();
100
+        }
101
+    }
91102
     "/usr/share/gardm/backgrounds/default.jpg".to_string()
92103
 }
93104