This commit is contained in:
Manuel Palenzuela 2019-10-21 20:19:22 +01:00
commit b4cd124c6c
3 changed files with 26 additions and 3 deletions

4
dwmbar
View file

@ -13,4 +13,6 @@ echo "dwmbar $VERSION"
} }
xsetroot -name "$(exec $RC_LOCATION)" while :; do
xsetroot -name "$(exec $RC_LOCATION)"
done

View file

@ -4,18 +4,18 @@ MODULES_DIR="modules/"
SEPARATOR=" | " SEPARATOR=" | "
MODULES="test archupdates weather date time" MODULES="volume temperature date time battery"
run_modules(){ run_modules(){
for module in $MODULES; do for module in $MODULES; do
[[ ! "$OUTPUT" = "" ]] && OUTPUT="$OUTPUT$SEPARATOR" [[ ! "$OUTPUT" = "" ]] && OUTPUT="$OUTPUT$SEPARATOR"
OUTPUT="$OUTPUT$(exec $MODULES_DIR$module)" OUTPUT="$OUTPUT$(exec $MODULES_DIR$module)"
done done
} }
run(){ run(){
run_modules run_modules
sleep 5; # Delays script before it's called again
echo $OUTPUT echo $OUTPUT
} }

21
modules/temperature Executable file
View file

@ -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