Changed a few icons to nerdfont
This commit is contained in:
parent
933b3a604a
commit
8a84e91d8e
@ -18,35 +18,35 @@ capacity_level="${capacity_level,,}"
|
|||||||
declare -A icons
|
declare -A icons
|
||||||
|
|
||||||
# Charging Icons (based on capacity level)
|
# Charging Icons (based on capacity level)
|
||||||
icons["charging_critical"]="⚡️"
|
icons["charging_critical"]=""
|
||||||
icons["charging_low"]="🔋"
|
icons["charging_low"]=""
|
||||||
icons["charging_normal"]="🔋"
|
icons["charging_normal"]=""
|
||||||
icons["charging_high"]="🔋"
|
icons["charging_high"]=""
|
||||||
icons["charging_full"]="🔌"
|
icons["charging_full"]=""
|
||||||
|
|
||||||
# Discharging Icons (based on capacity level)
|
# Discharging Icons (based on capacity level)
|
||||||
icons["discharging_critical"]="⚡️"
|
icons["discharging_critical"]=""
|
||||||
icons["discharging_low"]="🔋"
|
icons["discharging_low"]=""
|
||||||
icons["discharging_normal"]="🔋"
|
icons["discharging_normal"]=""
|
||||||
icons["discharging_high"]="🔋"
|
icons["discharging_high"]=""
|
||||||
icons["discharging_full"]="🔋"
|
icons["discharging_full"]=""
|
||||||
|
|
||||||
# Not Charging Icon (simplified to one icon)
|
# Not Charging Icon (simplified to one icon)
|
||||||
notcharging_icon="🔋"
|
notcharging_icon=""
|
||||||
|
|
||||||
# Unknown Icon (simplified to one icon)
|
# Unknown Icon (simplified to one icon)
|
||||||
unknown_icon="❓"
|
unknown_icon=""
|
||||||
|
|
||||||
# Determine the icon based on status and capacity level
|
# Determine the icon based on status and capacity level
|
||||||
if [[ "$status" == "charging" || "$status" == "discharging" ]]; then
|
if [[ "$status" == "charging" || "$status" == "discharging" ]]; then
|
||||||
icon_key="${status}_${capacity_level}"
|
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
|
elif [[ "$status" == "not charging" ]]; then
|
||||||
icon=$notcharging_icon
|
icon=$notcharging_icon
|
||||||
elif [[ "$status" == "unknown" ]]; then
|
elif [[ "$status" == "unknown" ]]; then
|
||||||
icon=$unknown_icon
|
icon=$unknown_icon
|
||||||
else
|
else
|
||||||
icon="❓" # Fallback icon if the status doesn't match known values
|
icon="" # Fallback icon if the status doesn't match known values
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Output the status in JSON format
|
# Output the status in JSON format
|
||||||
|
@ -8,24 +8,24 @@ s=${s%%\]*}
|
|||||||
|
|
||||||
if [[ $v == '0' ]]; then
|
if [[ $v == '0' ]]; then
|
||||||
s="empty";
|
s="empty";
|
||||||
ico="";
|
ico="";
|
||||||
elif [[ "$s" == "on" ]]; then
|
elif [[ "$s" == "on" ]]; then
|
||||||
s="low";
|
s="low";
|
||||||
ico="";
|
ico="";
|
||||||
if [[ $v -gt 35 ]]; then
|
if [[ $v -gt 35 ]]; then
|
||||||
s="med";
|
s="med";
|
||||||
ico=""; fi
|
ico=""; fi
|
||||||
if [[ $v -gt 50 ]]; then
|
if [[ $v -gt 50 ]]; then
|
||||||
s="high";
|
s="high";
|
||||||
ico=""; fi
|
ico=""; fi
|
||||||
if [[ $v -gt 80 ]]; then
|
if [[ $v -gt 80 ]]; then
|
||||||
s="vhigh";
|
s="vhigh";
|
||||||
ico=""; fi
|
ico=""; fi
|
||||||
if [[ $v -eq 100 ]]; then
|
if [[ $v -eq 100 ]]; then
|
||||||
s="full";
|
s="full";
|
||||||
ico=""; fi
|
ico=""; fi
|
||||||
else
|
else
|
||||||
ico="";
|
ico="";
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "{\"level\":\"$v\",\"status\":\"$s\",\"icon\":\"$ico\"}"
|
echo "{\"level\":\"$v\",\"status\":\"$s\",\"icon\":\"$ico\"}"
|
@ -5,6 +5,7 @@
|
|||||||
:valign "end"
|
:valign "end"
|
||||||
:height "${h}"
|
:height "${h}"
|
||||||
:width "${h}"
|
:width "${h}"
|
||||||
|
:tooltip "${battery.level}% ${battery.status}"
|
||||||
;:active true
|
;:active true
|
||||||
:text "${battery.icon}"
|
:text "${battery.icon}"
|
||||||
)
|
)
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
:height "${h}"
|
:height "${h}"
|
||||||
:width "${h}"
|
:width "${h}"
|
||||||
;:active true
|
;:active true
|
||||||
:text ""
|
:text ""
|
||||||
:tooltip "No notifications"
|
:tooltip "No notifications"
|
||||||
)
|
)
|
||||||
)
|
)
|
Loading…
Reference in New Issue
Block a user