From f09ba44366603812b1b4d843c8b7d6357773618d Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Sun, 11 Aug 2024 14:30:37 +0200 Subject: [PATCH] wallpaper: put a bigger penalty for already seen wallpapers --- bin/wallpaper | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/wallpaper b/bin/wallpaper index 58183d0..ca5ff41 100755 --- a/bin/wallpaper +++ b/bin/wallpaper @@ -218,8 +218,8 @@ def get_random_images(directory: str, number: int) -> list[Image]: except (OSError, ValueError): count = 0 counts.append(count) - counts = [count - min(counts) for count in counts] - weights = [100 / (count + 1) for count in counts] + counts = [(count - min(counts) + 1) ** 3 for count in counts] + weights = [100 / count for count in counts] images = [ PIL.Image.open(image) for image in random.choices(image_files, k=number, weights=weights)