This commit is contained in:
2026-05-28 01:31:30 -04:00
commit 88a4ce1e05
49 changed files with 1391 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
#!/bin/bash
# Get the current battery percentage
battery_percentage=$(cat /sys/class/power_supply/BAT1/capacity)
# Get the battery status (Charging or Discharging)
battery_status=$(cat /sys/class/power_supply/BAT1/status)
# Define the battery icons for each 10% segment
battery_icons=("󰂃" "󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰁹")
# Define the charging icon
charging_icon="󰂄"
# Calculate the index for the icon array
icon_index=$((battery_percentage / 10))
# Get the corresponding icon
battery_icon=${battery_icons[icon_index]}
# Check if the battery is charging
if [ "$battery_status" = "Charging" ]; then
battery_icon="$charging_icon"
fi
# Output the battery percentage and icon
echo "$battery_icon $battery_percentage%"