hell n back
This commit is contained in:
parent
3ee6761b45
commit
cac7203033
45 changed files with 2988 additions and 177 deletions
38
modules/eww/scripts/battery.sh
Executable file
38
modules/eww/scripts/battery.sh
Executable file
|
|
@ -0,0 +1,38 @@
|
|||
#!/bin/sh
|
||||
|
||||
bat=/sys/class/power_supply/BAT1/
|
||||
per="$(cat "$bat/capacity")"
|
||||
status="$(cat "$bat/status")"
|
||||
|
||||
if [ "$per" -gt "90" ]; then
|
||||
icon=""
|
||||
elif [ "$per" -gt "80" ]; then
|
||||
icon=""
|
||||
elif [ "$per" -gt "70" ]; then
|
||||
icon=""
|
||||
elif [ "$per" -gt "60" ]; then
|
||||
icon=""
|
||||
elif [ "$per" -gt "50" ]; then
|
||||
icon=""
|
||||
elif [ "$per" -gt "40" ]; then
|
||||
icon=""
|
||||
elif [ "$per" -gt "30" ]; then
|
||||
icon=""
|
||||
elif [ "$per" -gt "20" ]; then
|
||||
icon=""
|
||||
elif [ "$per" -gt "10" ]; then
|
||||
icon=""
|
||||
elif [ "$per" -gt "0" ]; then
|
||||
icon=""
|
||||
else
|
||||
icon=""
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
if [ -s /sys/class/power_supply/BAT1/capacity ]; then
|
||||
echo "{\"percent\": \"$per\", \"icon\": \"$icon\", \"charging\": \"$charging\", \"visible\": \"true\", \"status\": \"$status\"}"
|
||||
else
|
||||
echo "{\"visible\": \"false\" }"
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue