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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211 | diff --git a/Cargo.lock b/Cargo.lock
index 3327018..75dfd39 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -172,9 +172,9 @@ checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495"
[[package]]
name = "cc"
-version = "1.2.16"
+version = "1.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c"
+checksum = "1fcb57c740ae1daf453ae85f16e37396f672b039e00d9d866e07ddb24e328e3a"
dependencies = [
"jobserver",
"libc",
@@ -199,9 +199,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "clap"
-version = "4.5.32"
+version = "4.5.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6088f3ae8c3608d19260cd7445411865a485688711b78b5be70d78cd96136f83"
+checksum = "e958897981290da2a852763fe9cdb89cd36977a5d729023127095fa94d95e2ff"
dependencies = [
"clap_builder",
"clap_derive",
@@ -209,9 +209,9 @@ dependencies = [
[[package]]
name = "clap_builder"
-version = "4.5.32"
+version = "4.5.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "22a7ef7f676155edfb82daa97f99441f3ebf4a58d5e32f295a56259f1b6facc8"
+checksum = "83b0f35019843db2160b5bb19ae09b4e6411ac33fc6a712003c33e03090e2489"
dependencies = [
"anstream",
"anstyle",
@@ -410,9 +410,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
[[package]]
name = "image"
-version = "0.25.5"
+version = "0.25.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cd6f44aed642f18953a158afeb30206f4d50da59fbc66ecb53c66488de73563b"
+checksum = "db35664ce6b9810857a38a906215e75a9c879f0696556a39f59c62829710251a"
dependencies = [
"bytemuck",
"byteorder-lite",
@@ -532,9 +532,9 @@ dependencies = [
[[package]]
name = "log"
-version = "0.4.26"
+version = "0.4.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e"
+checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94"
[[package]]
name = "loop9"
@@ -651,9 +651,9 @@ dependencies = [
[[package]]
name = "once_cell"
-version = "1.21.1"
+version = "1.21.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc"
+checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
[[package]]
name = "palette_extract"
@@ -1061,7 +1061,7 @@ checksum = "852e951cb7832cb45cb1169900d19760cfa39b82bc0ea9c0e5a14ae88411c98b"
[[package]]
name = "walrs"
-version = "1.0.2"
+version = "1.0.3"
dependencies = [
"clap",
"color-thief",
@@ -1246,18 +1246,18 @@ dependencies = [
[[package]]
name = "zerocopy"
-version = "0.8.23"
+version = "0.8.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fd97444d05a4328b90e75e503a34bad781f14e28a823ad3557f0750df1ebcbc6"
+checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879"
dependencies = [
"zerocopy-derive",
]
[[package]]
name = "zerocopy-derive"
-version = "0.8.23"
+version = "0.8.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6352c01d0edd5db859a63e2605f4ea3183ddbd15e2c4a9e7d32184df75e4f154"
+checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be"
dependencies = [
"proc-macro2",
"quote",
diff --git a/Cargo.toml b/Cargo.toml
index 91150a2..a900f12 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,14 +1,14 @@
[package]
name = "walrs"
-version = "1.0.2"
+version = "1.0.3"
edition = "2024"
description = "walrs is a fast color scheme generator."
license = "GPL"
repository = "https://github.com/pixel2175/walrs"
[dependencies]
-clap = { version = "4.5.32", features = ["derive"] }
+clap = { version = "4.5.34", features = ["derive"] }
color-thief = "0.2.2"
dirs-next = "2.0.0"
-image = "0.25.5"
+image = "0.25.6"
palette_extract = "0.1.0"
diff --git a/src/create_templates.rs b/src/create_templates.rs
index 57255d6..9664275 100644
--- a/src/create_templates.rs
+++ b/src/create_templates.rs
@@ -29,7 +29,7 @@ fn fill_template(template_name: &str, template: &str, colors: &(Vec<(u8, u8, u8)
.replace("{wallpaper}", wallpaper)
.replace("{alpha}", &format!("{}", (alpha / 255) * 100));
- if colors.0.len() > 0 {
+ if !colors.0.is_empty() {
let background_patterns = [
"{background.strip}",
"{background.xrgba}",
@@ -119,7 +119,7 @@ pub fn create_template(colors: (Vec<(u8, u8, u8)>, u8), wallpaper: &str) {
has_user_templates = true;
let Ok(content) = read_to_string(entry.path()) else { continue };
let Some(name) = entry.file_name().into_string().ok() else { continue };
- fill_template(&name, &content, &colors, &wallpaper);
+ fill_template(&name, &content, &colors, wallpaper);
}
}
}
@@ -138,7 +138,7 @@ pub fn create_template(colors: (Vec<(u8, u8, u8)>, u8), wallpaper: &str) {
let user_file_path = format!("{}{}", user_template_path, name);
let _ = write(&user_file_path, &content);
- fill_template(&name, &content, &colors, &wallpaper);
+ fill_template(&name, &content, &colors, wallpaper);
}
}
}
diff --git a/src/get_colors.rs b/src/get_colors.rs
index 7c27d51..fbe229f 100644
--- a/src/get_colors.rs
+++ b/src/get_colors.rs
@@ -1,5 +1,4 @@
use color_thief::ColorFormat;
-use image;
use palette_extract::{MaxColors, Quality,};
use std::collections::HashSet;
use std::process::exit;
diff --git a/src/main.rs b/src/main.rs
index 0d95034..a974840 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -13,8 +13,7 @@ use std::process::exit;
use utils::*;
#[derive(Parser, Debug)]
-#[command(name = "walrs",version="v1.0.1",about= "walrs - Generate colorscheme from image")]
-
+#[command(name = "walrs",version="v1.0.3",about= "walrs - Generate colorscheme from image")]
struct Arg {
/// path/to/your/wal.png
#[arg(short = 'i')]
diff --git a/src/reload.rs b/src/reload.rs
index b88a7c0..bfbd8e5 100644
--- a/src/reload.rs
+++ b/src/reload.rs
@@ -108,7 +108,7 @@ pub fn reload(send:bool) {
};
- let wallpaper = read_to_string(&format!("{}/wal/wal",cache)).expect("run 'cp /etc/walrs/templates/wal ~/.config/walrs/templates/' and restart app").lines().next().unwrap().trim().to_string();
+ let wallpaper = read_to_string(format!("{}/wal/wal",cache)).expect("run 'cp /etc/walrs/templates/wal ~/.config/walrs/templates/' and restart app").lines().next().unwrap().trim().to_string();
wallpaper::change_wallpaper(wallpaper.as_str(),send);
colors(lines,send);
diff --git a/src/wallpaper.rs b/src/wallpaper.rs
index 64905bd..25bf0b8 100644
--- a/src/wallpaper.rs
+++ b/src/wallpaper.rs
@@ -113,7 +113,7 @@ fn set_wm_wallpaper(img: &str, send: bool) {
info("Wallpaper", "wallpaper set with nitrogen", send);
} else if run("which xsetroot") {
warning("Wallpaper", "using xsetroot, but it does not support images properly", send);
- spawn(&format!("xsetroot -solid '#000000'"));
+ spawn("xsetroot -solid '#000000'");
info("Wallpaper", "set solid background with xsetroot", send);
} else {
warning("Wallpaper", "can't find any app to set wallpaper", send);
|