widget = luastatus.require_plugin('battery-linux').widget{ period = 2, cb = function(t) icon = "" if t.status == "Discharging" then if t.capacity < 10 then icon = "󰁺" elseif t.capacity < 20 then icon = "󰁻" elseif t.capacity < 30 then icon = "󰁼" elseif t.capacity < 40 then icon = "󰁽" elseif t.capacity < 50 then icon = "󰁾" elseif t.capacity < 60 then icon = "󰁿" elseif t.capacity < 70 then icon = "󰂀" elseif t.capacity < 80 then icon = "󰂁" elseif t.capacity < 90 then icon = "󰂂" else icon = "󰁹" end else if t.capacity < 10 then icon = "󰢜" elseif t.capacity < 20 then icon = "󰂆" elseif t.capacity < 30 then icon = "󰂇" elseif t.capacity < 40 then icon = "󰂈" elseif t.capacity < 50 then icon = "󰢝" elseif t.capacity < 60 then icon = "󰂉" elseif t.capacity < 70 then icon = "󰢞" elseif t.capacity < 80 then icon = "󰂊" elseif t.capacity < 90 then icon = "󰂋" else icon = "󰂅" end end return string.format('%s %3d%%', icon, t.capacity) end, }