Skip to content
Open
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,10 @@ calculate the next wallpaper accordingly. When `sorting` is set to `random`, it
all the wallpapers shown in a queue, so that the commands `next` and `previous` can work
as intended.

**Notice**: _the queue only works when `queue-size` setting (which defaults to `10`) is bigger
than the number of available images in the folder_.
**Notice**: _by default the queue is sized to the number of available images and follows it as
the folder changes, so no wallpaper is repeated until all of them have been shown; then a new
cycle starts. Set `queue-size` to limit how many recently shown wallpapers are remembered
instead._

The cycling of images can also be paused/resumed by running the `pause` and `resume` commands, or just `toggle-pause`, using _wpaperctl_:

Expand Down Expand Up @@ -163,7 +165,7 @@ represents a different display and can contain the following keys:
- `offset`, offset the image on the screen, with a value from `0.0` to `1.0`. (_Optional_, `0.0` by
default for `tile` mode and `0.5` for all the other modes)
- `queue-size`, decide how big the queue should be when `path` is set a directory and `sorting` is
set to `random`. (_Optional_, `10` by default)
set to `random`. (_Optional_, sized to the number of available images by default)
- `initial-transition`, enable the initial transition at wpaperd startup. (_Optional_, true by default)
- `recursive`, recursively iterate the directory `path` when looking for available wallpapers;
it is only valid when `path` points to a directory. (_Optional_, true by default)
Expand Down
6 changes: 3 additions & 3 deletions daemon/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ use serde::Deserialize;
use smithay_client_toolkit::reexports::calloop::ping::Ping;

use crate::{
image_picker::ImagePicker,
render::Transition,
wallpaper_info::{BackgroundMode, Recursive, Sorting, WallpaperInfo},
};
Expand Down Expand Up @@ -209,8 +208,9 @@ impl SerializedWallpaperInfo {
(None, None) => BackgroundMode::default(),
};
let drawn_images_queue_size = match (&self.queue_size, &default.queue_size) {
(Some(size), _) | (None, Some(size)) => *size,
(None, None) => ImagePicker::DEFAULT_DRAWN_IMAGES_QUEUE_SIZE,
(Some(size), _) | (None, Some(size)) => Some(*size),
// None means the queue follows the number of available wallpapers
(None, None) => None,
};
let initial_transition = match (&self.initial_transition, &default.initial_transition) {
(Some(initial_transition), _) | (None, Some(initial_transition)) => *initial_transition,
Expand Down
4 changes: 4 additions & 0 deletions daemon/src/filelist_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ impl FilelistCache {
event_loop_handle
.insert_source(ping_source, move |_, _, wpaperd| {
wpaperd.filelist_cache.borrow_mut().update_cache();
// Queues sized to the collection follow it as it changes
for surface in &mut wpaperd.surfaces {
surface.update_automatic_queue_size();
}
})
.map_err(|e| eyre!("{e:?}"))
.wrap_err("Failed to insert the filelist cache watcher in the event loop")?;
Expand Down
Loading
Loading