Changed a few icons to nerdfont

This commit is contained in:
Candifloss 2024-12-14 00:34:18 +05:30
parent 933b3a604a
commit 8a84e91d8e
4 changed files with 23 additions and 22 deletions

View File

@ -18,35 +18,35 @@ capacity_level="${capacity_level,,}"
declare -A icons
# Charging Icons (based on capacity level)
icons["charging_critical"]="⚡️"
icons["charging_low"]="🔋"
icons["charging_normal"]="🔋"
icons["charging_high"]="🔋"
icons["charging_full"]="🔌"
icons["charging_critical"]="󰢜"
icons["charging_low"]="󰂇"
icons["charging_normal"]="󰢝"
icons["charging_high"]="󰂋"
icons["charging_full"]="󰂄"
# Discharging Icons (based on capacity level)
icons["discharging_critical"]="⚡️"
icons["discharging_low"]="🔋"
icons["discharging_normal"]="🔋"
icons["discharging_high"]="🔋"
icons["discharging_full"]="🔋"
icons["discharging_critical"]="󰂎"
icons["discharging_low"]="󰁻"
icons["discharging_normal"]="󰁿"
icons["discharging_high"]="󰂂"
icons["discharging_full"]="󰁹"
# Not Charging Icon (simplified to one icon)
notcharging_icon="🔋"
notcharging_icon="󰂃"
# Unknown Icon (simplified to one icon)
unknown_icon=""
unknown_icon="󰂑"
# Determine the icon based on status and capacity level
if [[ "$status" == "charging" || "$status" == "discharging" ]]; then
icon_key="${status}_${capacity_level}"
icon="${icons[$icon_key]:-"❓"}" # Default to ❓ if no specific icon is found
icon="${icons[$icon_key]:-"󰂑"}" # Default to 󰂑 if no specific icon is found
elif [[ "$status" == "not charging" ]]; then
icon=$notcharging_icon
elif [[ "$status" == "unknown" ]]; then
icon=$unknown_icon
else
icon="" # Fallback icon if the status doesn't match known values
icon="󰂑" # Fallback icon if the status doesn't match known values
fi
# Output the status in JSON format

View File

@ -8,24 +8,24 @@ s=${s%%\]*}
if [[ $v == '0' ]]; then
s="empty";
ico="";
ico="";
elif [[ "$s" == "on" ]]; then
s="low";
ico="";
ico="";
if [[ $v -gt 35 ]]; then
s="med";
ico=""; fi
ico=""; fi
if [[ $v -gt 50 ]]; then
s="high";
ico=""; fi
ico=""; fi
if [[ $v -gt 80 ]]; then
s="vhigh";
ico=""; fi
ico=""; fi
if [[ $v -eq 100 ]]; then
s="full";
ico=""; fi
ico=""; fi
else
ico="";
ico="";
fi
echo "{\"level\":\"$v\",\"status\":\"$s\",\"icon\":\"$ico\"}"

View File

@ -5,6 +5,7 @@
:valign "end"
:height "${h}"
:width "${h}"
:tooltip "${battery.level}% ${battery.status}"
;:active true
:text "${battery.icon}"
)

View File

@ -6,7 +6,7 @@
:height "${h}"
:width "${h}"
;:active true
:text ""
:text "󰂚"
:tooltip "No notifications"
)
)