From ad327267bdc57d554adffd0620ef2bab7a5121a9 Mon Sep 17 00:00:00 2001 From: David Udelson Date: Sat, 27 May 2017 12:19:42 -0400 Subject: [PATCH] Change bat widget discharging state char from U+2212 to U+002D This avoids using a unicode character that looks just like a hyphen but isn't, leading to subtle bugs when developers write code that interacts with the bat_linux widget. --- widgets/bat_linux.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/widgets/bat_linux.lua b/widgets/bat_linux.lua index 0f12ad1..db81961 100644 --- a/widgets/bat_linux.lua +++ b/widgets/bat_linux.lua @@ -31,7 +31,7 @@ local function worker(format, warg) ["Unknown\n"] = "⌁", ["Charged\n"] = "↯", ["Charging\n"] = "+", - ["Discharging\n"] = "−" + ["Discharging\n"] = "-" } -- Get current power usage in watt @@ -80,7 +80,7 @@ local function worker(format, warg) if rate ~= nil and rate ~= 0 then if state == "+" then timeleft = (tonumber(capacity) - tonumber(remaining)) / tonumber(rate) - elseif state == "−" then + elseif state == "-" then timeleft = tonumber(remaining) / tonumber(rate) else return {state, percent, time, wear, curpower}