diff --git a/bindings.lua b/bindings.lua index 86095b4..fd33802 100644 --- a/bindings.lua +++ b/bindings.lua @@ -61,6 +61,7 @@ globalkeys = awful.util.table.join( awful.key({ modkey, }, "p", function () awful.util.spawn("pidgin") end), awful.key({ modkey, }, "s", function () awful.util.spawn("sunbird") end), awful.key({ modkey, }, "g", function () awful.util.spawn("gmpc") end), + awful.key({ modkey, }, "w", function () awful.util.spawn("awsetbg -a -r /home/crater2150/.config/awesome/walls/ &") end), awful.key({ }, "XF86Mail", function () awful.util.spawn("xset dpms force off") end), awful.key({ }, "XF86Mail", function () awful.util.spawn("xset dpms force off") end), awful.key({ modkey }, "XF86Mail", function () awful.util.spawn("urslock") end), diff --git a/rc.lua b/rc.lua index 35141a2..a3ee0bb 100644 --- a/rc.lua +++ b/rc.lua @@ -16,6 +16,8 @@ require("aweswt") +MY_PATH = os.getenv("HOME") .. "/.config/awesome/" +WALLPATH = MY_PATH .. "walls/" -- Themes define colours, icons, and wallpapers beautiful.init("/home/crater2150/.config/awesome/zenburn/theme.lua") @@ -33,7 +35,6 @@ layouts = awful.layout.suit.floating } -MY_PATH = os.getenv("HOME") .. "/.config/awesome/" dofile (MY_PATH .. "helpers.lua") dofile (MY_PATH .. "tags.lua") @@ -41,5 +42,5 @@ dofile (MY_PATH .. "wibox.lua") dofile (MY_PATH .. "bindings.lua") dofile (MY_PATH .. "rules.lua") dofile (MY_PATH .. "signals.lua") - +dofile (MY_PATH .. "wallpaper.lua") diff --git a/wallpaper.lua b/wallpaper.lua new file mode 100644 index 0000000..32e7b4c --- /dev/null +++ b/wallpaper.lua @@ -0,0 +1,29 @@ +-- seed and "pop a few" +math.randomseed( os.time()) +for i=1,1000 do tmp=math.random(0,1000) end + +x = 0 + +-- setup the timer +mytimer = timer { timeout = x } +mytimer:add_signal("timeout", function() + + -- tell awsetbg to randomly choose a wallpaper from your wallpaper directory + os.execute("awsetbg -a -r /home/crater2150/.config/awesome/walls/ &") + + + -- stop the timer (we don't need multiple instances running at the same time) + mytimer:stop() + + -- define the interval in which the next wallpaper change should occur in seconds + -- (in this case anytime between 10 and 20 minutes) + x = math.random( 600, 1200) + + --restart the timer + mytimer.timeout = x + mytimer:start() +end) + +-- initial start when rc.lua is first run +mytimer:start() + diff --git a/zenburn/theme.lua b/zenburn/theme.lua index 346a717..8da8b9d 100644 --- a/zenburn/theme.lua +++ b/zenburn/theme.lua @@ -8,7 +8,7 @@ -- {{{ Main theme = {} -theme.wallpaper_cmd = { "nitrogen --restore" } +theme.wallpaper_cmd = { "/bin/true" } -- }}} -- {{{ Styles