mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-07-06 16:24:22 +02:00
wallpaper: use integers for aspect ratios
This commit is contained in:
parent
1c9a2b1272
commit
fbc9821d36
1 changed files with 2 additions and 2 deletions
|
@ -76,8 +76,8 @@ images = images[: len(screens)]
|
||||||
# If more than one screen and one image has the right aspect ratio,
|
# If more than one screen and one image has the right aspect ratio,
|
||||||
# use it.
|
# use it.
|
||||||
if len(screens) > 1:
|
if len(screens) > 1:
|
||||||
target = screen.width_in_pixels * 100 / screen.height_in_pixels
|
target = screen.width_in_pixels * 100 // screen.height_in_pixels
|
||||||
ratios = [image.size[0] * 100 / image.size[1] for image in images]
|
ratios = [image.size[0] * 100 // image.size[1] for image in images]
|
||||||
try:
|
try:
|
||||||
index = ratios.index(target)
|
index = ratios.index(target)
|
||||||
images = [images[index]]
|
images = [images[index]]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue