Commit cdcb2d02a7e4be819d71154128136522baa3b04b

Thomas de Grivel 2021-02-21T13:07:33

x1

diff --git a/.Xdefaults-x1 b/.Xdefaults-x1
new file mode 100644
index 0000000..53602ed
--- /dev/null
+++ b/.Xdefaults-x1
@@ -0,0 +1,8 @@
+! $OpenBSD: dot.Xdefaults,v 1.3 2014/07/10 10:22:59 jasper Exp $
+XTerm*loginShell:true
+XTerm*jumpScroll:true
+XTerm*saveLines:10240
+XTerm*scrollBar:false
+XTerm*faceSize:18
+XTerm*font:courier
+XTerm*faceName:courier
diff --git a/bin/battery-x1 b/bin/battery-x1
new file mode 100755
index 0000000..7f3132e
--- /dev/null
+++ b/bin/battery-x1
@@ -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-x1 b/bin/status-x1
new file mode 100755
index 0000000..417afb2
--- /dev/null
+++ b/bin/status-x1
@@ -0,0 +1,2 @@
+#!/bin/sh
+xsetroot -name "$(hostname) $(~/bin/egress_interface) $(~/bin/host-ip) $(~/bin/nwid) $(~/bin/load) $(~/bin/temperature-x1) $(~/bin/battery-x1)$(~/bin/plugged) $(date)"
diff --git a/bin/temperature-x1 b/bin/temperature-x1
new file mode 100755
index 0000000..a805a9a
--- /dev/null
+++ b/bin/temperature-x1
@@ -0,0 +1,4 @@
+#!/bin/sh
+CPUTEMP=$(sysctl -n hw.sensors.cpu0.temp0 | cut -d\  -f 1)
+MBTEMP=$(sysctl -n hw.sensors.acpitz0.temp0 | cut -d\  -f 1)
+echo "${CPUTEMP}°C ${MBTEMP}°C"