From: Christian Heller <c.heller@plomlompom.de>
Date: Tue, 4 Mar 2025 01:56:48 +0000 (+0100)
Subject: Improve status bar.
X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/decks/static/%7B%7Bdb.prefix%7D%7D/balance?a=commitdiff_plain;h=b12586365a3fafc0cfd6f6f316f61ab2bfb61e99;p=config

Improve status bar.
---

diff --git a/testing/home/t490s/.nonpath_bins/status.sh b/testing/home/t490s/.nonpath_bins/status.sh
index 9e2b365..256d9c0 100755
--- a/testing/home/t490s/.nonpath_bins/status.sh
+++ b/testing/home/t490s/.nonpath_bins/status.sh
@@ -1,12 +1,13 @@
 #!/bin/sh
 # see sway-bar(5) and swaybar-protocol(7)
-MEGA=1000
+KILO=1000
 printf '{ "version": 1 }\n[\n' 
 while true; do
   printf '  [\n'
-  printf '    {"full_text": "%s"},\n' "$(ip -4 addr show scope global | grep -oP '(?<=inet\s)\d+(\.\d+){3}')"
-  printf '    {"full_text": "%d° C"},\n' $(calc "$(cat /sys/class/thermal/thermal_zone0/temp) // ${MEGA}")  # thermal_zone0 is what ACPI's interested in, so probably a fair choice among the many alternatives
-  printf '    {"full_text": "%s"},\n' "$(date +'%Y-%m-%d %H:%M:%S/%Z')"
+  printf '    {"separator_block_width": 20, "full_text": "%s"},\n' "$(ip -4 addr show scope global | grep -oP '(?<=inet\s)\d+(\.\d+){3}')"
+  printf '    {"separator_block_width": 20, "full_text": "%s"},\n' "$(cat /sys/class/power_supply/BAT0/status)"
+  printf '    {"separator_block_width": 20, "full_text": "%d° C"},\n' $(calc "$(cat /sys/class/thermal/thermal_zone0/temp) // ${KILO}")
+  printf '    {"separator_block_width": 20, "full_text": "%s"},\n' "$(date +'%Y-%m-%d %H:%M:%S/%Z')"
   printf '  ],\n'
   sleep 1
 done