added status-bat for dwm, will use with xmonad too I think
This commit is contained in:
parent
47377fd30e
commit
95c5019d3e
33
scripts/status-bat
Executable file
33
scripts/status-bat
Executable 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%"
|
||||
@ -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>"
|
||||
|
||||
|
||||
|
||||
@ -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>"
|
||||
|
||||
Reference in New Issue
Block a user