From 01cd34c02d3fc7742704602e82f8770e0153f086 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 12 Sep 2023 09:09:06 +0400 Subject: [PATCH] redo bar --- config/dwmbar/bar.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 config/dwmbar/bar.sh diff --git a/config/dwmbar/bar.sh b/config/dwmbar/bar.sh new file mode 100644 index 00000000..285148c5 --- /dev/null +++ b/config/dwmbar/bar.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +battery() { + get_capacity="$(cat /sys/class/power_supply/BAT*/capacity)" + get_status="$(cat /sys/class/power_supply/BAT*/status)" + case "$get_status" in + Charging) printf "^c$blue^ 󰂄 $get_capacity" ;; + Discharging) printf "^c$white^ ^b$blue 󰁹 $get_capacity" + esac +} + +while true; do + sleep 1 && xsetroot -name "$(battery)" +done