fix statusbar

This commit is contained in:
Sakooooo 2023-09-12 10:58:28 +04:00
parent 6040e3daa5
commit cd7aa5db00
Signed by: sako
GPG key ID: 3FD715D87D7725E0
2 changed files with 3 additions and 7 deletions

View file

@ -954,7 +954,7 @@ drawbar(Monitor *m)
/* draw status first so it can be overdrawn by tags later */ /* draw status first so it can be overdrawn by tags later */
if (m == selmon) { /* status is only drawn on selected monitor */ if (m == selmon) { /* status is only drawn on selected monitor */
tw = m->ww - drawstatusbar(m, bh, stext); sw = m->ww - drawstatusbar(m, bh, stext);
} }
resizebarwin(m); resizebarwin(m);

View file

@ -4,11 +4,7 @@ blue=#0000ff
battery() { battery() {
get_capacity="$(cat /sys/class/power_supply/BAT1/capacity)" get_capacity="$(cat /sys/class/power_supply/BAT1/capacity)"
get_status="$(cat /sys/class/power_supply/BAT1/status)" printf "$get_capacity"
case "$get_status" in
Charging) printf "^c$blue^ 󰂄 $get_capacity" ;;
Discharging) printf "^b$blue 󰁹 $get_capacity" ;;
esac
} }
audio() { audio() {
@ -21,6 +17,6 @@ audio() {
} }
while true; do while true; do
xsetroot -name "$(battery)" xsetroot -name "$(battery) $(audio)"
sleep 1 sleep 1
done done