Re-set wallpaper on screen's property::geometry

Imagine that you have two screens of different resolution and you change their
position (xrandr --output first --left-of second). Of course, the wallpaper has
to be updated afterwards.

This commit makes the default config do that.

Fixes: https://github.com/awesomeWM/awesome/issues/1102
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2016-09-23 09:51:21 +02:00
parent c7f5a9acd3
commit 750a1df1c7
1 changed files with 9 additions and 2 deletions

View File

@ -165,8 +165,7 @@ mytasklist.buttons = awful.util.table.join(
awful.client.focus.byidx(-1)
end))
awful.screen.connect_for_each_screen(function(s)
-- Wallpaper
local function set_wallpaper(s)
if beautiful.wallpaper then
local wallpaper = beautiful.wallpaper
-- If wallpaper is a function, call it with the screen
@ -175,6 +174,14 @@ awful.screen.connect_for_each_screen(function(s)
end
gears.wallpaper.maximized(wallpaper, s, true)
end
end
-- Re-set wallpaper when a screen's geometry changes (e.g. different resolution)
screen.connect_signal("property::geometry", set_wallpaper)
awful.screen.connect_for_each_screen(function(s)
-- Wallpaper
set_wallpaper(s)
-- Each screen has its own tag table.
awful.tag({ "1", "2", "3", "4", "5", "6", "7", "8", "9" }, s, awful.layout.layouts[1])