scripts
This commit is contained in:
commit
6e5095f3cf
35 changed files with 453 additions and 0 deletions
27
dwm/charge.sh
Executable file
27
dwm/charge.sh
Executable file
|
|
@ -0,0 +1,27 @@
|
|||
#!/bin/sh
|
||||
|
||||
level=$(cat /sys/class/power_supply/BAT0/capacity)
|
||||
stats=$(cat /sys/class/power_supply/BAT0/status)
|
||||
|
||||
dicon=( )
|
||||
uicon=( )
|
||||
|
||||
if [ $stats == "Charging" ]; then
|
||||
icon=${uicon[$(( level / 10 ))]}
|
||||
else
|
||||
icon=${dicon[$(( level / 10 ))]}
|
||||
fi
|
||||
|
||||
if [ $level -ge 0 ]; then
|
||||
color="^c#F75341^"
|
||||
fi
|
||||
|
||||
if [ $level -ge 20 ]; then
|
||||
color="^c#FED06E^"
|
||||
fi
|
||||
|
||||
if [ $level -ge 50 ]; then
|
||||
color="^c#98DC37^"
|
||||
fi
|
||||
|
||||
echo "${color}${icon} ${level}%"
|
||||
Loading…
Add table
Add a link
Reference in a new issue