chwp 1.239.71

Change your wallpaper from the command line interface.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::cli;

/// Writes a gnome settings entry
pub fn write_settings(key: &str, value: &str) {
    if !is_settings_value_equals(key, value) {
        cli::execute_command(format!("gsettings set {key} {value}").as_str());
    }
}

/// Checks if the value of a gnome setting is equal to the given value
pub fn is_settings_value_equals(key: &str, value: &str) -> bool {
    read_settings(key) == *value
}

/// Reads the value of a gnome setting
fn read_settings(key: &str) -> String {
    cli::execute_command(format!("gsettings get {key}").as_str())
}