added status-bat for dwm, will use with xmonad too I think

This commit is contained in:
Solomon Laing 2022-05-09 16:13:54 +09:30
parent 47377fd30e
commit 95c5019d3e
3 changed files with 52 additions and 2 deletions

33
scripts/status-bat Executable file
View File

@ -0,0 +1,33 @@
#!/bin/bash -x
icon=" "
current=$(acpi --battery | sed -e 's/%.*//' | sed 's/.*, //')
state=$(acpi --battery | sed -e 's/,.*//' | sed 's/.*: //')
if [[ "$state" == "Discharging" ]]; then
case $((current/5/4)) in
1)
icon=""
;;
2)
icon=""
;;
3)
icon=""
;;
4)
icon=""
;;
5)
icon=""
;;
esac
fi
if [[ "$state" == "Not charging" ]]; then
icon=""
fi
echo "$icon $current%"

View File

@ -33,6 +33,6 @@ else
color=$red
icon="" # fa-volume-off f026
fi
echo "<fc=$color><fn=1>$icon </fn> $status</fc>"
echo "<fc=$color><fn=1>$icon </fn>$status</fc>"

View File

@ -15,5 +15,22 @@ readarray -t y <<< "$weather"
loc=${y[0]}
temp=${y[1]}
color=""
echo -e "<fc=#ff79c6>$loc <fc=#FFFFFF>$temp</fc><fn=1>\u00b0</fn>C</fc>"
if ((temp > 30))
then
color="#ff5555"
elif ((temp > 25))
then
color="#ffb86c"
elif ((temp > 20))
then
color="#f1fa8c"
elif ((temp > 10))
then
color="#50fa7b"
else
color="#8be9fd"
fi
echo -e "<fc=#ff79c6>$loc <fc=$color>$temp</fc><fn=1>\u00b0</fn>C</fc>"