Switch to 8 levels of vertical bar for battery icon.
This commit is contained in:
parent
11b9a08635
commit
ee1899cf4d
@ -1 +1,2 @@
|
||||
rust_date: "2022-10-14"
|
||||
# Check that rust-analyzer is valid for date on https://rust-lang.github.io/rustup-components-history/
|
||||
rust_date: "2023-03-18"
|
||||
|
@ -25,18 +25,24 @@ while true; do
|
||||
else
|
||||
battery_icon="⚡"
|
||||
fi
|
||||
elif [ $battery_percentage -le 20 ]; then
|
||||
battery_icon="○"# ⚠
|
||||
elif [ $battery_percentage -le 40 ]; then
|
||||
battery_icon="◔"
|
||||
elif [ $battery_percentage -le 60 ]; then
|
||||
battery_icon="◑"
|
||||
elif [ $battery_percentage -le 80 ]; then
|
||||
battery_icon="◕"
|
||||
elif [ $battery_percentage -le 12 ]; then
|
||||
battery_icon="⚠"
|
||||
elif [ $battery_percentage -le 25 ]; then
|
||||
battery_icon="▁"
|
||||
elif [ $battery_percentage -le 37 ]; then
|
||||
battery_icon="▂"
|
||||
elif [ $battery_percentage -le 50 ]; then
|
||||
battery_icon="▃"
|
||||
elif [ $battery_percentage -le 62 ]; then
|
||||
battery_icon="▄"
|
||||
elif [ $battery_percentage -le 75 ]; then
|
||||
battery_icon="▅"
|
||||
elif [ $battery_percentage -le 87 ]; then
|
||||
battery_icon="▆"
|
||||
elif [ $battery_percentage -lt 100 ]; then
|
||||
battery_icon="●"
|
||||
battery_icon="▇"
|
||||
else
|
||||
battery_icon="●"# █▇▆▅▄▃▂▁ ⚠ ▕▅▏
|
||||
battery_icon="█"
|
||||
fi
|
||||
|
||||
if [ $battery_percentage -le 15 ]; then
|
||||
|
@ -13,33 +13,45 @@ function generate_battery_update {
|
||||
local battery_state=$(grep 'state:' <<<"$battery_status" | awk '{print $2}')
|
||||
local battery_percentage=$(grep 'percentage:' <<<"$battery_status" | awk '{print $2}')
|
||||
battery_percentage=${battery_percentage%\%}
|
||||
set +e
|
||||
local time_remaining=$(grep 'time to empty:' <<<"$battery_status" | sed 's/\W*time to empty:\W*//g')
|
||||
local tooltip="$time_remaining until empty"
|
||||
if [ -z "$time_remaining" ]; then
|
||||
time_remaining=$(grep 'time to full:' <<<"$battery_status" | sed 's/\W*time to full:\W*//g')
|
||||
tooltip="$time_remaining until full"
|
||||
if [ -z "$time_remaining" ]; then
|
||||
tooltip="fully charged"
|
||||
else
|
||||
tooltip="$time_remaining until full"
|
||||
fi
|
||||
fi
|
||||
set -e
|
||||
local battery_icon=""
|
||||
local class=""
|
||||
|
||||
if [ $battery_state = "charging" ]; then
|
||||
if [ $battery_percentage -eq 100 ]; then
|
||||
battery_icon="⚉"
|
||||
battery_icon="⚡"
|
||||
else
|
||||
battery_icon="⚇"
|
||||
battery_icon="⚡"
|
||||
fi
|
||||
elif [ $battery_percentage -le 20 ]; then
|
||||
battery_icon="⚋"
|
||||
elif [ $battery_percentage -le 40 ]; then
|
||||
battery_icon="⚊"
|
||||
elif [ $battery_percentage -le 60 ]; then
|
||||
battery_icon="⚍"
|
||||
elif [ $battery_percentage -le 80 ]; then
|
||||
battery_icon="⚌"
|
||||
elif [ $battery_percentage -le 12 ]; then
|
||||
battery_icon="⚠"
|
||||
elif [ $battery_percentage -le 25 ]; then
|
||||
battery_icon="▁"
|
||||
elif [ $battery_percentage -le 37 ]; then
|
||||
battery_icon="▂"
|
||||
elif [ $battery_percentage -le 50 ]; then
|
||||
battery_icon="▃"
|
||||
elif [ $battery_percentage -le 62 ]; then
|
||||
battery_icon="▄"
|
||||
elif [ $battery_percentage -le 75 ]; then
|
||||
battery_icon="▅"
|
||||
elif [ $battery_percentage -le 87 ]; then
|
||||
battery_icon="▆"
|
||||
elif [ $battery_percentage -lt 100 ]; then
|
||||
battery_icon="☱"
|
||||
battery_icon="▇"
|
||||
else
|
||||
battery_icon="☰"
|
||||
battery_icon="█"
|
||||
fi
|
||||
|
||||
if [ $battery_percentage -le 15 ]; then
|
||||
|
Loading…
Reference in New Issue
Block a user