From 7e6637a8dc646f5f9c500f1edc83c35d5bffed7d Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Fri, 31 Aug 2018 17:46:36 +0200 Subject: [PATCH 1/2] Added shortcut to change wallpaper --- awesome/rc.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/awesome/rc.lua b/awesome/rc.lua index 8c10dfb..cf3c71f 100644 --- a/awesome/rc.lua +++ b/awesome/rc.lua @@ -507,7 +507,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( From f760c82d04cf113d1e291cf26723f0c79f4cf519 Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Fri, 31 Aug 2018 17:47:36 +0200 Subject: [PATCH 2/2] Random wallpaper --- awesome/rc.lua | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/awesome/rc.lua b/awesome/rc.lua index cf3c71f..2df814c 100644 --- a/awesome/rc.lua +++ b/awesome/rc.lua @@ -25,14 +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() 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 current_wallpaper_index = math.floor(1 + math.random() * (max_wallpaper_index)) local wallpaper = wallpaper_root .. string.format("%04d", current_wallpaper_index) .. '.jpg' gears.wallpaper.maximized(wallpaper, s, true) end