X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/29ae2ec2d413e2f788712eac3df372b4a5534fe5..fc3f86b5697211c0c1086cfe8af3518608cd3f60:/widgets/bat.lua?ds=sidebyside diff --git a/widgets/bat.lua b/widgets/bat.lua index 2da5e2d..ec9a289 100644 --- a/widgets/bat.lua +++ b/widgets/bat.lua @@ -75,7 +75,6 @@ local function worker(args) local sum_energy_full = 0 local sum_energy_percentage = 0 local pspath = "/sys/class/power_supply/" - pspath = "/home/luke/Download/" for i, battery in ipairs(batteries) do local bstr = pspath .. battery @@ -132,7 +131,7 @@ local function worker(args) local hours = math.floor(rate_time) local minutes = math.floor((rate_time - hours) * 60) - bat_now.perc = tonumber(string.format("%d", math.min(100, sum_energy_percentage / #batteries))) + bat_now.perc = tonumber(string.format("%d", math.floor(math.min(100, sum_energy_percentage / #batteries)))) bat_now.time = string.format("%02d:%02d", hours, minutes) bat_now.watt = tonumber(string.format("%.2f", sum_rate_energy / 1e6)) elseif bat_now.status == "Full" then