Skip to content

Commit 7fe279f

Browse files
Added vendored_sources meson option and code cleanup.
1 parent 6731a73 commit 7fe279f

18 files changed

Lines changed: 101 additions & 104 deletions

.cargo/config.toml

Whitespace-only changes.

.cargo/config.toml.disabled

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[source.crates-io]
2+
replace-with = "vendored-sources"
3+
4+
[source."vendored-sources"]
5+
directory = "vendor"

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "waytrogen"
3-
version = "0.9.6"
3+
version = "0.9.8"
44
edition = "2024"
55

66
[dependencies]

flake.lock

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,12 @@
2626
strictDeps = true;
2727
nativeBuildInputs = with pkgs; [
2828
pkg-config
29-
glib
30-
wrapGAppsHook4
31-
bash
3229
dbus
3330
];
3431
buildInputs = with pkgs; [
35-
glib
36-
gtk4
3732
ffmpeg
3833
sqlite
3934
openssl
40-
gsettings-desktop-schemas
4135
libX11
4236
libXcursor
4337
libXrandr
@@ -64,7 +58,7 @@
6458
# Layer 3: Meson handles everything else (i18n, schemas, icons, desktop file)
6559
waytrogen = pkgs.stdenv.mkDerivation {
6660
pname = "waytrogen";
67-
version = "0.9.6";
61+
version = "0.9.8";
6862
src = ./.;
6963

7064

@@ -73,33 +67,22 @@
7367
ninja
7468
pkg-config
7569
desktop-file-utils
76-
wrapGAppsHook4
77-
makeWrapper
78-
glib
79-
sqlite
80-
bash
81-
rustc
82-
gtk4
8370
dbus
8471
cargo-udeps
8572
xdg-utils
8673
xdg-desktop-portal
74+
rustc
8775
];
8876

8977
buildInputs = with pkgs; [
90-
glib
91-
gtk4
9278
ffmpeg
9379
sqlite
94-
openssl
9580
dbus
9681
xdg-utils
9782
xdg-desktop-portal
9883
];
9984

10085
mesonFlags = [
101-
"-Dcargo_features=nixos"
102-
# Point meson at the pre-built binary from layer 2
10386
"-Dprecompiled_binary=${waytrogen-bin}/bin/waytrogen"
10487
];
10588

@@ -150,30 +133,20 @@
150133
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${pkgs.lib.makeLibraryPath buildInputs}"
151134
'';
152135
nativeBuildInputs = with pkgs; [
153-
glibcLocales
154136
pkg-config
155-
glib
156-
wrapGAppsHook4
157-
bash
158137
cargo-udeps
159138
meson
160139
ninja
161140
desktop-file-utils
162141
dbus
163142
];
164143
buildInputs = with pkgs; [
165-
glib
166-
gtk4
167144
ffmpeg
168-
sqlite
169145
openssl
170-
gsettings-desktop-schemas
171146
killall
172-
socat
173147
cargo
174148
clippy
175149
rust-analyzer
176-
sqlite
177150
pkg-config
178151
libX11
179152
libXcursor

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
project(
22
'waytrogen',
33
'rust',
4-
version: '0.9.6',
4+
version: '0.9.8',
55
license: 'Unlicence',
66
meson_version: '>= 1.2.0',
77
default_options: ['rust_std=2021'],

meson_options.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
option('cargo_features', type: 'string', value: '')
22
option('debian_install', type: 'boolean', value: false)
3-
option('precompiled_binary', type: 'string', value: '')
3+
option('precompiled_binary', type: 'string', value: '')
4+
option('vendored_sources', type: 'boolean', value: false)

src/app_state.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ impl BootFn<AppState, Messages> for AppState {
376376
if !instance.swaybg_color.starts_with('#') {
377377
instance.swaybg_color = "#000000".to_string();
378378
}
379-
if instance.awww_fill_color.is_empty() || instance.awww_fill_color.contains("#") {
379+
if instance.awww_fill_color.is_empty() || instance.awww_fill_color.contains('#') {
380380
instance.awww_fill_color = "000000ff".to_string();
381381
}
382382
if instance.gslapper_scale_mode.is_none() {
@@ -539,7 +539,7 @@ impl AppState {
539539
rayon::spawn(move || {
540540
let mut entries: Vec<(PathBuf, SortKey)> = WalkDir::new(&wf)
541541
.into_iter()
542-
.filter_map(|e| e.ok())
542+
.filter_map(std::result::Result::ok)
543543
.filter_map(|e| {
544544
let path = e.into_path();
545545
let ext = path.extension()?.to_str()?.to_ascii_lowercase();
@@ -652,8 +652,11 @@ impl AppState {
652652
let mut all_images = self.image_grid_images.clone();
653653
all_images.append(&mut self.filtered_images.clone());
654654

655-
let accepted_formats = self.changer.as_ref().map(|c| c.accepted_formats());
656-
let favorites_only = self.favorite_images_only.clone();
655+
let accepted_formats = self
656+
.changer
657+
.as_ref()
658+
.map(super::wallpaper_changers::WallpaperChanger::accepted_formats);
659+
let favorites_only = self.favorite_images_only;
657660

658661
Task::future(async move {
659662
let (tx, rx) = futures::channel::oneshot::channel();
@@ -756,20 +759,20 @@ impl AppState {
756759
image_file.favorite = !image_file.favorite;
757760
debug!("Image favorite After: {}", image_file.favorite);
758761
match conn.insert_image_file(&image_file) {
759-
Ok(_) => {
762+
Ok(()) => {
760763
self.image_grid_images
761764
.iter_mut()
762765
.filter(|p| p.path == image_path)
763766
.for_each(|p| {
764767
p.favorite = !p.favorite;
765-
debug!("File: {:#?}", p);
768+
debug!("File: {p:#?}");
766769
});
767770
self.filtered_images
768771
.iter_mut()
769772
.filter(|p| p.path == image_path)
770773
.for_each(|p| {
771774
p.favorite = !p.favorite;
772-
debug!("File: {:#?}", p);
775+
debug!("File: {p:#?}");
773776
});
774777
if self.favorite_images_only {
775778
self.filter_images(self.image_filter.clone())

src/changers/awww.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ pub fn change_awww_wallpaper(awww_changer: WallpaperChangers, image: PathBuf, mo
7676
.arg("--resize")
7777
.arg(resize_mode)
7878
.arg("--fill-color")
79-
.arg(&settings.fill_color.replace("#", ""));
79+
.arg(settings.fill_color.replace('#', ""));
8080
if monitor != TRANSLATION.get_translation("All") {
8181
command.arg("--outputs").arg(monitor);
8282
}

0 commit comments

Comments
 (0)