This commit is contained in:
crater2150 2010-10-24 17:17:10 +02:00
parent 787dfa94bd
commit 1532b44948
4 changed files with 34 additions and 3 deletions

View file

@ -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),

5
rc.lua
View file

@ -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")

29
wallpaper.lua Normal file
View file

@ -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()

View file

@ -8,7 +8,7 @@
-- {{{ Main
theme = {}
theme.wallpaper_cmd = { "nitrogen --restore" }
theme.wallpaper_cmd = { "/bin/true" }
-- }}}
-- {{{ Styles