Random wallpaper
This commit is contained in:
parent
7e6637a8dc
commit
f760c82d04
|
@ -25,14 +25,10 @@ local wallpaper_root = home .. "/Pictures/current-wallpapers/"
|
||||||
local max_wallpaper_index = 192
|
local max_wallpaper_index = 192
|
||||||
math.randomseed(os.time())
|
math.randomseed(os.time())
|
||||||
|
|
||||||
current_wallpaper_index = math.floor(1 + math.random() * (max_wallpaper_index))
|
|
||||||
|
|
||||||
function update_wallpaper()
|
function update_wallpaper()
|
||||||
for s = 1, screen.count() do
|
for s = 1, screen.count() do
|
||||||
current_wallpaper_index = current_wallpaper_index + 1
|
local current_wallpaper_index = math.floor(1 + math.random() * (max_wallpaper_index))
|
||||||
if current_wallpaper_index > max_wallpaper_index then
|
|
||||||
current_wallpaper_index = 1
|
|
||||||
end
|
|
||||||
local wallpaper = wallpaper_root .. string.format("%04d", current_wallpaper_index) .. '.jpg'
|
local wallpaper = wallpaper_root .. string.format("%04d", current_wallpaper_index) .. '.jpg'
|
||||||
gears.wallpaper.maximized(wallpaper, s, true)
|
gears.wallpaper.maximized(wallpaper, s, true)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue