X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/1046cf6ce9b6a96ab6d6ef3ea7e9ffca07e12822..e8a34ec0e718448d367e677fdd88eda8c3ceaefc:/widget/contrib/tp_smapi.lua diff --git a/widget/contrib/tp_smapi.lua b/widget/contrib/tp_smapi.lua index 7192990..b8acbe2 100644 --- a/widget/contrib/tp_smapi.lua +++ b/widget/contrib/tp_smapi.lua @@ -12,6 +12,7 @@ local gears = require("gears") local naughty = require("naughty") local wibox = require("wibox") local string = string +local type = type -- ThinkPad battery infos and widget creator -- http://www.thinkwiki.org/wiki/Tp_smapi @@ -19,7 +20,7 @@ local string = string local function factory(apipath) local tp_smapi = { - path = apipath or "/sys/devices/platform/tp_smapi" + path = apipath or "/sys/devices/platform/smapi" } function tp_smapi.get(batid, feature) @@ -73,7 +74,7 @@ local function factory(apipath) tp_smapi.notification = naughty.notify { title = string.format("%s: %s %s (%s)", batid, mfgr, model, chem), text = msg, - timeout = seconds or 0, + timeout = type(seconds) == "number" and seconds or 0, screen = scr or focused() } end