Adding zoom-fill (#3917)
This commit is contained in:
parent
b9d8305639
commit
67f5e7feca
|
@ -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`:
|
||||
--
|
||||
|
|
|
@ -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
|
||||
|
Loading…
Reference in New Issue