From 984903f8c5465887fc09f62c2a3160c07d0dd0b4 Mon Sep 17 00:00:00 2001 From: Thomas FORGIONE Date: Fri, 25 Nov 2016 09:37:50 +0100 Subject: [PATCH] Added multiple possible wallpapers resolution --- awesome/rc.lua | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/awesome/rc.lua b/awesome/rc.lua index 5e8873d..9be11ff 100644 --- a/awesome/rc.lua +++ b/awesome/rc.lua @@ -64,23 +64,26 @@ function file_exists(name) if f~=nil then io.close(f) return true else return false end end -function change_wallpaper(path) +function change_wallpaper(path, extension) path = home .. '/Pictures/Wallpapers/' .. path - if not file_exists(path) then - return - end + -- if not file_exists(path) then + -- return + -- end theme.wallpaper = path if beautiful.wallpaper then - for s = 1, screen.count() do - gears.wallpaper.maximized(beautiful.wallpaper, s, true) + if screen.count() == 2 and file_exists(path..'-16-9.'..extension) and file_exists(path..'-4-3.'..extension) then + 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 -change_wallpaper('arch2.png') +change_wallpaper('arch2', 'png') -- Widgets local volume = require("volume") @@ -118,11 +121,11 @@ local layouts = -- }}} -- {{{ Wallpaper -if beautiful.wallpaper then - for s = 1, screen.count() do - gears.wallpaper.maximized(beautiful.wallpaper, s, true) - end -end +-- if beautiful.wallpaper then +-- for s = 1, screen.count() do +-- gears.wallpaper.maximized(beautiful.wallpaper, s, true) +-- end +-- end -- }}} -- {{{ Tags