Adding zoom-fill (#3917)

This commit is contained in:
Stardust-kyun 2024-08-20 14:28:20 -04:00 committed by GitHub
parent b9d8305639
commit 67f5e7feca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 27 additions and 0 deletions

View File

@ -30,6 +30,11 @@
--
--@DOC_awful_wallpaper_mazimized3_EXAMPLE@
--
-- To maintain the image's aspect ratio while filling the
-- screen, the image can be cropped using `gears.surface`:
--
--@DOC_awful_wallpaper_mazimized4_EXAMPLE@
--
-- Finally, it is also possible to use simpler "branding" in a corner using
-- `awful.placement`:
--

View File

@ -0,0 +1,22 @@
--DOC_NO_USAGE --DOC_GEN_IMAGE
local awful = { wallpaper = require("awful.wallpaper") } --DOC_HIDE
local wibox = require("wibox") --DOC_HIDE
local beautiful = require("beautiful") --DOC_HIDE
local gears = require("gears") --DOC_HIDE
screen[1]._resize {x = 0, y = 0, width = 320, height = 196} --DOC_HIDE
local s = screen[1] --DOC_HIDE
awful.wallpaper {
screen = s,
widget = {
image = gears.surface.crop_surface {
surface = gears.surface.load_uncached(beautiful.wallpaper),
ratio = s.geometry.width/s.geometry.height,
},
widget = wibox.widget.imagebox,
},
}
require("gears.timer").run_delayed_calls_now() --DOC_HIDE