Compare commits

..

3 Commits

Author SHA1 Message Date
519eecbc4b
Merge branch 'dev' into mercury
nvim: consistent names for LSP hints
statusbar: handle >100% battery cases
2022-06-11 12:25:17 +02:00
72d94850b4 [statusbar] feat: handle >100% battery cases 2022-06-11 12:24:01 +02:00
David JULIEN
1bd3ea5adc [nvim] fix: consistent names for diagnostics 2022-06-08 10:29:35 +02:00
3 changed files with 22 additions and 18 deletions

View File

@ -8,7 +8,7 @@ local M = {} -- The module to export
M = {
-- misc
sign_error = "",
sign_warning = "",
sign_warn = "",
sign_hint = "",
sign_info = "",
}

View File

@ -102,10 +102,10 @@ end
local function get_lsp_diagnostics()
local result = {}
local levels = {
errors = "Error",
warnings = "Warn",
error = "Error",
warn = "Warn",
info = "Info",
hints = "Hint"
hint = "Hint"
}
for k, level in pairs(levels) do
@ -152,12 +152,12 @@ local left = table.concat {
{
process_diagnostics(
globals.sign_error .. " ",
diagnostics.errors,
diagnostics.error,
"%#DiagnosticVirtualTextError#"
),
process_diagnostics(
globals.sign_warning .. " ",
diagnostics.warnings,
globals.sign_warn .. " ",
diagnostics.warn,
"%#DiagnosticVirtualTextWarn#"
),
process_diagnostics(

View File

@ -43,18 +43,22 @@ do
status=" " && capacity="FULL"
printf " %s:%s(%s) " "$slot" "$status" "$capacity"
else
if [ "$status" = "Charging" ]; then
status=""
if [ 100 -lt $(expr $capacity) ]; then
status=""
else
case "$capacity" in
100|[8-9][0-9]) status="" ;;
[6-7][0-9]) status="" ;;
[4-5][0-9]) status="" ;;
[2-3][0-9]) status="" ;;
*) status="" ;;
esac
[ "BAT0" = $slot ] && [ 30 -gt $capacity ] && notify;
if [ "$status" = "Charging" ]; then
status=""
else
case "$capacity" in
100|[8-9][0-9]) status="" ;;
[6-7][0-9]) status="" ;;
[4-5][0-9]) status="" ;;
[2-3][0-9]) status="" ;;
*) status="" ;;
esac
[ "BAT0" = $slot ] && [ 30 -gt $capacity ] && notify;
fi
printf " %s:%s (%0.2d%%) " "$slot" "$status" "$capacity";
fi
printf " %s:%s (%0.2d%%) " "$slot" "$status" "$capacity";
fi
done