fix: remove invalid battery symbols
This commit is contained in:
parent
1bd6df4840
commit
f65bba3afa
@ -87,24 +87,28 @@ wezterm.on("update-status", function(window, pane)
|
|||||||
local battery = ""
|
local battery = ""
|
||||||
for _, b in ipairs(wezterm.battery_info()) do
|
for _, b in ipairs(wezterm.battery_info()) do
|
||||||
local charge_percent = b.state_of_charge * 100
|
local charge_percent = b.state_of_charge * 100
|
||||||
local battery_icon = ""
|
local battery_icon = ""
|
||||||
|
|
||||||
if charge_percent < 100 then
|
if charge_percent < 100 then
|
||||||
battery_icon = ""
|
battery_icon = ""
|
||||||
|
elseif charge_percent < 90 then
|
||||||
|
battery_icon = ""
|
||||||
|
elseif charge_percent < 80 then
|
||||||
|
battery_icon = ""
|
||||||
elseif charge_percent < 70 then
|
elseif charge_percent < 70 then
|
||||||
battery_icon = ""
|
battery_icon = ""
|
||||||
elseif charge_percent < 60 then
|
elseif charge_percent < 60 then
|
||||||
battery_icon = ""
|
battery_icon = ""
|
||||||
elseif charge_percent < 50 then
|
elseif charge_percent < 50 then
|
||||||
battery_icon = ""
|
battery_icon = ""
|
||||||
elseif charge_percent < 40 then
|
elseif charge_percent < 40 then
|
||||||
battery_icon = ""
|
battery_icon = ""
|
||||||
elseif charge_percent < 30 then
|
elseif charge_percent < 30 then
|
||||||
battery_icon = ""
|
battery_icon = ""
|
||||||
elseif charge_percent < 20 then
|
elseif charge_percent < 20 then
|
||||||
battery_icon = ""
|
battery_icon = ""
|
||||||
elseif charge_percent < 10 then
|
elseif charge_percent < 10 then
|
||||||
battery_icon = ""
|
battery_icon = ""
|
||||||
end
|
end
|
||||||
|
|
||||||
battery = battery_icon .. " " .. string.format("%.0f%%", charge_percent)
|
battery = battery_icon .. " " .. string.format("%.0f%%", charge_percent)
|
||||||
|
@ -111,7 +111,7 @@
|
|||||||
newline
|
newline
|
||||||
# ip # ip address and bandwidth usage for a specified network interface
|
# ip # ip address and bandwidth usage for a specified network interface
|
||||||
# proxy # system-wide http/https/ftp proxy
|
# proxy # system-wide http/https/ftp proxy
|
||||||
battery # internal battery
|
# battery # internal battery
|
||||||
# wifi # wifi speed
|
# wifi # wifi speed
|
||||||
# example # example user-defined segment (see prompt_example function below)
|
# example # example user-defined segment (see prompt_example function below)
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user