Added multiple possible wallpapers resolution

This commit is contained in:
Thomas FORGIONE 2016-11-25 09:37:50 +01:00
parent bc64f83dde
commit 984903f8c5
No known key found for this signature in database
GPG Key ID: 2A210FFC062E00C3
1 changed files with 15 additions and 12 deletions

View File

@ -64,23 +64,26 @@ function file_exists(name)
if f~=nil then io.close(f) return true else return false end if f~=nil then io.close(f) return true else return false end
end end
function change_wallpaper(path) function change_wallpaper(path, extension)
path = home .. '/Pictures/Wallpapers/' .. path path = home .. '/Pictures/Wallpapers/' .. path
if not file_exists(path) then -- if not file_exists(path) then
return -- return
end -- end
theme.wallpaper = path theme.wallpaper = path
if beautiful.wallpaper then if beautiful.wallpaper then
for s = 1, screen.count() do if screen.count() == 2 and file_exists(path..'-16-9.'..extension) and file_exists(path..'-4-3.'..extension) then
gears.wallpaper.maximized(beautiful.wallpaper, s, true) gears.wallpaper.maximized(path .. '-16-9.' .. extension, 1, true)
gears.wallpaper.maximized(path .. '-4-3.' .. extension, 2, true)
elseif file_exists(path..'.'..extension) then
gears.wallpaper.maximized(path .. '.' .. extension, 1, true)
end end
end end
end end
change_wallpaper('arch2.png') change_wallpaper('arch2', 'png')
-- Widgets -- Widgets
local volume = require("volume") local volume = require("volume")
@ -118,11 +121,11 @@ local layouts =
-- }}} -- }}}
-- {{{ Wallpaper -- {{{ Wallpaper
if beautiful.wallpaper then -- if beautiful.wallpaper then
for s = 1, screen.count() do -- for s = 1, screen.count() do
gears.wallpaper.maximized(beautiful.wallpaper, s, true) -- gears.wallpaper.maximized(beautiful.wallpaper, s, true)
end -- end
end -- end
-- }}} -- }}}
-- {{{ Tags -- {{{ Tags