Compare commits
3 Commits
7fe2da7d37
...
519eecbc4b
Author | SHA1 | Date | |
---|---|---|---|
519eecbc4b | |||
72d94850b4 | |||
|
1bd3ea5adc |
@ -8,7 +8,7 @@ local M = {} -- The module to export
|
|||||||
M = {
|
M = {
|
||||||
-- misc
|
-- misc
|
||||||
sign_error = "",
|
sign_error = "",
|
||||||
sign_warning = "",
|
sign_warn = "",
|
||||||
sign_hint = "",
|
sign_hint = "",
|
||||||
sign_info = "",
|
sign_info = "",
|
||||||
}
|
}
|
||||||
|
@ -102,10 +102,10 @@ end
|
|||||||
local function get_lsp_diagnostics()
|
local function get_lsp_diagnostics()
|
||||||
local result = {}
|
local result = {}
|
||||||
local levels = {
|
local levels = {
|
||||||
errors = "Error",
|
error = "Error",
|
||||||
warnings = "Warn",
|
warn = "Warn",
|
||||||
info = "Info",
|
info = "Info",
|
||||||
hints = "Hint"
|
hint = "Hint"
|
||||||
}
|
}
|
||||||
|
|
||||||
for k, level in pairs(levels) do
|
for k, level in pairs(levels) do
|
||||||
@ -152,12 +152,12 @@ local left = table.concat {
|
|||||||
{
|
{
|
||||||
process_diagnostics(
|
process_diagnostics(
|
||||||
globals.sign_error .. " ",
|
globals.sign_error .. " ",
|
||||||
diagnostics.errors,
|
diagnostics.error,
|
||||||
"%#DiagnosticVirtualTextError#"
|
"%#DiagnosticVirtualTextError#"
|
||||||
),
|
),
|
||||||
process_diagnostics(
|
process_diagnostics(
|
||||||
globals.sign_warning .. " ",
|
globals.sign_warn .. " ",
|
||||||
diagnostics.warnings,
|
diagnostics.warn,
|
||||||
"%#DiagnosticVirtualTextWarn#"
|
"%#DiagnosticVirtualTextWarn#"
|
||||||
),
|
),
|
||||||
process_diagnostics(
|
process_diagnostics(
|
||||||
|
@ -43,18 +43,22 @@ do
|
|||||||
status=" " && capacity="FULL"
|
status=" " && capacity="FULL"
|
||||||
printf " %s:%s(%s) " "$slot" "$status" "$capacity"
|
printf " %s:%s(%s) " "$slot" "$status" "$capacity"
|
||||||
else
|
else
|
||||||
if [ "$status" = "Charging" ]; then
|
if [ 100 -lt $(expr $capacity) ]; then
|
||||||
status=""
|
status=""
|
||||||
else
|
else
|
||||||
case "$capacity" in
|
if [ "$status" = "Charging" ]; then
|
||||||
100|[8-9][0-9]) status="" ;;
|
status=""
|
||||||
[6-7][0-9]) status="" ;;
|
else
|
||||||
[4-5][0-9]) status="" ;;
|
case "$capacity" in
|
||||||
[2-3][0-9]) status="" ;;
|
100|[8-9][0-9]) status="" ;;
|
||||||
*) status="" ;;
|
[6-7][0-9]) status="" ;;
|
||||||
esac
|
[4-5][0-9]) status="" ;;
|
||||||
[ "BAT0" = $slot ] && [ 30 -gt $capacity ] && notify;
|
[2-3][0-9]) status="" ;;
|
||||||
|
*) status="" ;;
|
||||||
|
esac
|
||||||
|
[ "BAT0" = $slot ] && [ 30 -gt $capacity ] && notify;
|
||||||
|
fi
|
||||||
|
printf " %s:%s (%0.2d%%) " "$slot" "$status" "$capacity";
|
||||||
fi
|
fi
|
||||||
printf " %s:%s (%0.2d%%) " "$slot" "$status" "$capacity";
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
Reference in New Issue
Block a user