put files in folder

This commit is contained in:
2026-04-30 02:11:36 +03:00
parent fdd6ede51d
commit 32ed8b850a
38 changed files with 1495 additions and 1 deletions
+29
View File
@@ -0,0 +1,29 @@
#!/bin/bash
icons=("󰂎" "󱊡" "󱊢" "󱊣")
state_file="/tmp/battery_anim_index"
# init
[ ! -f "$state_file" ] && echo 0 > "$state_file"
i=$(cat "$state_file")
capacity=$(cat /sys/class/power_supply/BAT0/capacity)
status=$(cat /sys/class/power_supply/BAT0/status)
if [ "$capacity" -le 15 ]; then
echo "{\"text\": \"󰂃 Connect charger $capacity%\", \"class\": \"critical\"}"
elif [ "$capacity" -le 25 ]; then
echo "{\"text\": \"󰂃 Battery low $capacity%\", \"class\": \"warning\"}"
elif [[ "$status" == "Full" ]]; then
echo "{\"text\": \"󰁹 Battery full $capacity%\", \"class\": \"full\"}"
elif [[ "$status" == "Charging" ]]; then
echo "{\"text\": \"${icons[$i]} Charging $capacity%\", \"class\": \"charging\"}"
i=$(( (i+1) % ${#icons[@]} ))
echo $i > "$state_file"
else
echo "{\"text\": \"󰁹 $capacity%\", \"class\": \"normal\"}"
fi