From 2d17c849c9961578fbbb61bf539dd1df84c5800b Mon Sep 17 00:00:00 2001 From: "Archie Hilton (thytom)" Date: Mon, 21 Oct 2019 20:14:37 +0100 Subject: [PATCH 1/2] Added temperature module --- modules/temperature | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 modules/temperature diff --git a/modules/temperature b/modules/temperature new file mode 100755 index 0000000..19c3de3 --- /dev/null +++ b/modules/temperature @@ -0,0 +1,21 @@ +#!/bin/bash + +# Gets temperature of the CPU +# Dependencies: lm_sensors + +get_temperature() +{ + # CPU_T=$(cat /sys/devices/platform/coretemp.0/hwmon/hwmon?/temp2_input) + # CPU_TEMP=$(expr $CPU_T / 1000) + + CPU_TEMP="$(sensors | grep temp1 | awk '{print $2}')" + + # elif [ "$CPU_TEMP" -le 10 ]; then + # echo "  $CPU_TEMP" + # else + # echo " $CPU_TEMP" + # fi + echo " $CPU_TEMP" +} + +get_temperature From b5c4b37658e862fba58af3634dcdba3d50ea5db1 Mon Sep 17 00:00:00 2001 From: "Archie Hilton (thytom)" Date: Mon, 21 Oct 2019 20:15:51 +0100 Subject: [PATCH 2/2] Added delayed refreshing. --- dwmbar | 4 +++- dwmbarrc | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/dwmbar b/dwmbar index 195bd31..a4818b6 100755 --- a/dwmbar +++ b/dwmbar @@ -13,4 +13,6 @@ echo "dwmbar $VERSION" } -xsetroot -name "$(exec $RC_LOCATION)" +while :; do + xsetroot -name "$(exec $RC_LOCATION)" +done diff --git a/dwmbarrc b/dwmbarrc index dbedf22..9610857 100755 --- a/dwmbarrc +++ b/dwmbarrc @@ -4,18 +4,18 @@ MODULES_DIR="modules/" SEPARATOR=" | " -MODULES="test archupdates weather date time" +MODULES="volume temperature date time battery" run_modules(){ for module in $MODULES; do [[ ! "$OUTPUT" = "" ]] && OUTPUT="$OUTPUT$SEPARATOR" - OUTPUT="$OUTPUT$(exec $MODULES_DIR$module)" done } run(){ run_modules + sleep 5; # Delays script before it's called again echo $OUTPUT }