From 4dad2e360c1c464feef9a8aaff6e96a7636c54b7 Mon Sep 17 00:00:00 2001 From: "Adrian C. (anrxc)" Date: Sun, 14 Mar 2010 03:37:40 +0100 Subject: API: missing warg should not break awesome --- widgets/bat.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'widgets/bat.lua') diff --git a/widgets/bat.lua b/widgets/bat.lua index d6e3e6b..9fc438d 100644 --- a/widgets/bat.lua +++ b/widgets/bat.lua @@ -20,9 +20,10 @@ module("vicious.widgets.bat") -- {{{ Battery widget type -local function worker(format, batid) - -- Apple PMU and ACPI/procfs battery widgets are in the [contrib] branch - local battery = helpers.pathtotable("/sys/class/power_supply/" .. batid) +local function worker(format, warg) + if not warg then return end + + local battery = helpers.pathtotable("/sys/class/power_supply/"..warg) local battery_state = { ["Full\n"] = "↯", ["Unknown\n"] = "⌁", -- cgit v1.2.3