-
Notifications
You must be signed in to change notification settings - Fork 3
Examples
Guff edited this page Jul 23, 2011
·
2 revisions
hook.connect("auth-failed", function () utils.sleep(3) end)
local delay = 3
hook.connect("auth-failed", function ()
utils.sleep(delay)
delay = delay + 3
end)
local delay = 3
hook.connect("auth-failed", function ()
utils.sleep(delay)
delay = math.min(delay + 3, 60)
end)
hook.connect("lock", function () utils.spawn("mpc pause") end)
hook.connect("unlock", function () utils.spawn("mpc play") end)
require "odious"
batt_box = odious.widget.progressbar{ width = 20, height = 60, x = 0.8, y = 0.1 }
batt_box:set_border_color("white"):set_vertical(true):set_color("green")
batt_timer = timer(function ()
local batt_info = odious.util.get_battery("BAT0")
local level = batt_info.charge_now / batt_info.charge_full
batt_box:set_value(level)
end, 1)
batt_timer:start()