diff options
| author | czjstmax <jstmaxlol@disroot.org> | 2026-01-31 20:29:50 +0100 |
|---|---|---|
| committer | czjstmax <jstmaxlol@disroot.org> | 2026-01-31 20:29:50 +0100 |
| commit | 89b6005535ac1999a1296956942738d6a61ac5ac (patch) | |
| tree | 7a92ae8101b6f0f288200f5998fb46ab8414fdb9 /cfg/i3/kurobar.sh | |
| parent | d30b31f14424ef3283315e340c389c808e5a0a5f (diff) | |
updated stuff
Signed-off-by: czjstmax <jstmaxlol@disroot.org>
Diffstat (limited to 'cfg/i3/kurobar.sh')
| -rw-r--r-- | cfg/i3/kurobar.sh | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/cfg/i3/kurobar.sh b/cfg/i3/kurobar.sh index a9d82a0..aadcab3 100644 --- a/cfg/i3/kurobar.sh +++ b/cfg/i3/kurobar.sh @@ -11,6 +11,20 @@ while true; do bat="N/A" fi + # --- battery charge status --- silly --- + status=$(cat /sys/class/power_supply/BAT*/status) + + if [[ "$status" == "Charging" && "$bat" -lt 70 ]]; then + charge_status="++ing~!" + elif [[ "$status" == "Charging" && "$bat" -ge 70 ]]; then + charge_status="++ing but.. i'm full~~" + elif [[ "$status" == "Discharging" && "$bat" -lt 40 ]]; then + charge_status="++ me~~!" + else + charge_status="--ing" + fi + + # --- ram usage in gb --- mem_used=$(free -g | awk '/^Mem:/ {print $3}') mem_total=$(free -g | awk '/^Mem:/ {print $2}') @@ -39,7 +53,7 @@ while true; do dt=$(date '+%Y年%m月%d日 %H時%M分%S秒') # --- print bar line --- - echo "vol.$volume% | bat.$bat% | bri.$bright | lan.$localip | pub.$pubip | "$mem_used"/"$mem_total"gb | $dt" + echo "vol.$volume% | $charge_status ($bat%) | bri.$bright | lan.$localip | pub.$pubip | "$mem_used"/"$mem_total"gb | $dt" sleep 0.01 done |