From 3aadbe63fb6be1aaba0658ebda19478dedca1550 Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Wed, 5 Sep 2018 11:55:21 +0200 Subject: [PATCH] Same wallpaper on both screens --- awesome/rc.lua | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/awesome/rc.lua b/awesome/rc.lua index 8c10dfb..1a36db0 100644 --- a/awesome/rc.lua +++ b/awesome/rc.lua @@ -25,15 +25,10 @@ local wallpaper_root = home .. "/Pictures/current-wallpapers/" local max_wallpaper_index = 192 math.randomseed(os.time()) -current_wallpaper_index = math.floor(1 + math.random() * (max_wallpaper_index)) - function update_wallpaper() + local index = math.floor(1 + math.random() * (max_wallpaper_index)) + local wallpaper = wallpaper_root .. string.format("%04d", index) .. '.jpg' for s = 1, screen.count() do - current_wallpaper_index = current_wallpaper_index + 1 - if current_wallpaper_index > max_wallpaper_index then - current_wallpaper_index = 1 - end - local wallpaper = wallpaper_root .. string.format("%04d", current_wallpaper_index) .. '.jpg' gears.wallpaper.maximized(wallpaper, s, true) end end @@ -507,7 +502,9 @@ globalkeys = awful.util.table.join( os.execute('xdotool type --clearmodifiers ' .. options.email:sub(i,i)) end end) - end, {description="lol", group="autoinput"}) + end, {description="lol", group="autoinput"}), + + awful.key({modkey}, "e", update_wallpaper) ) clientkeys = awful.util.table.join(