Commit 176bdb339c5db167ae1743f244a837bd9aeedaf6

Thomas de Grivel 2021-02-20T15:59:32

t410

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