Commit 41de247e3b1a7e2e4347f03364f3fe41360fc75d

Thomas de Grivel 2021-02-20T15:55:48

t430

diff --git a/bin/battery-t430 b/bin/battery-t430
new file mode 100755
index 0000000..7f3132e
--- /dev/null
+++ b/bin/battery-t430
@@ -0,0 +1,5 @@
+#!/bin/sh
+MAX="$(sysctl -n hw.sensors.acpibat0.watthour0 | cut -d ' ' -f 1)"      
+POWER="$(sysctl -n hw.sensors.acpibat0.watthour3 | cut -d ' ' -f 1)" 
+PERCENT=$({ echo scale=1; echo "$POWER*100/$MAX"; } | bc) 
+echo ${PERCENT}%
diff --git a/bin/status-t430 b/bin/status-t430
new file mode 100755
index 0000000..cc6584a
--- /dev/null
+++ b/bin/status-t430
@@ -0,0 +1,2 @@
+#!/bin/sh
+xsetroot -name "$(hostname) $(~/bin/egress_interface) $(~/bin/host-ip) $(~/bin/nwid) $(~/bin/load) $(~/bin/temperature-t430) $(~/bin/battery-t430)$(~/bin/plugged) $(date)"
diff --git a/bin/temperature-t430 b/bin/temperature-t430
new file mode 100755
index 0000000..1ce9f40
--- /dev/null
+++ b/bin/temperature-t430
@@ -0,0 +1,4 @@
+#!/bin/sh
+CPUTEMP=$(sysctl -n hw.sensors.cpu0.temp0 | cut -d\  -f 1)
+MBTEMP=$(sysctl -n hw.sensors.acpithinkpad0.temp0 | cut -d\  -f 1)
+echo "${CPUTEMP}°C ${MBTEMP}°C"