-
-
Save anonymous/37f3b1c58d6616cab756 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- configuration - edit to your liking | |
wp_index = 1 | |
wp_timeout = 10 | |
wp_path = "/path/to/wallpapers/" | |
wp_files = { "01.jpg", "02.jpg", "03.jpg" } | |
-- setup the timer | |
wp_timer = timer { timeout = wp_timeout } | |
wp_timer:connect_signal("timeout", function() | |
-- set wallpaper to current index for all screens | |
for s = 1, screen.count() do | |
gears.wallpaper.maximized(wp_path .. wp_files[wp_index], s, true) | |
end | |
-- stop the timer (we don't need multiple instances running at the same time) | |
wp_timer:stop() | |
-- get next random index | |
wp_index = math.random( 1, #wp_files) | |
--restart the timer | |
wp_timer.timeout = wp_timeout | |
wp_timer:start() | |
end) | |
-- initial start when rc.lua is first run | |
wp_timer:start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment