mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-08-05 02:34:48 +02:00
wallpaper: favor bigger images
This commit is contained in:
parent
2588551af0
commit
197e5cdb1d
1 changed files with 3 additions and 1 deletions
|
@ -55,8 +55,10 @@ for base, _, files in os.walk(os.path.join(options.directory)):
|
|||
'.jpeg',
|
||||
'.png'):
|
||||
images.append(os.path.join(base, i))
|
||||
images = random.sample(images, len(screens))
|
||||
images = random.sample(images, len(screens) + 3)
|
||||
images = [Image.open(image) for image in images]
|
||||
images.sort(key=lambda im: -im.size[0]*im.size[1])
|
||||
images = images[:len(screens)]
|
||||
|
||||
# If more than one screen and one image has the right aspect ratio,
|
||||
# use it.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue