From aa039acc39d32c2d39f2a7fbcb3c441729601dc3 Mon Sep 17 00:00:00 2001 From: elena Date: Mon, 25 Sep 2017 14:19:49 +0300 Subject: [PATCH] updated cpu and weather scripts --- Scripts/cpu.sh | 13 ++++++++++--- Scripts/weather.sh | 13 ++++++++----- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/Scripts/cpu.sh b/Scripts/cpu.sh index 663165d..ccbe4d1 100755 --- a/Scripts/cpu.sh +++ b/Scripts/cpu.sh @@ -2,10 +2,17 @@ #    CPU="$[100-$(vmstat 1 2|tail -1|awk '{printf "%d", $15}')]" -GOVERNOR="$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor)" +# GOVERNOR="$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor)" -if [[ "$GOVERNOR" == "performance" ]]; then +# if [[ "$GOVERNOR" == "performance" ]]; then +# echo " $CPU%" +# else +# echo " $CPU%" +# fi + +# Lazy whitespace padding +if [ "$CPU" -ge "10" ]; then echo " $CPU%" else - echo " $CPU%" + echo " $CPU%" fi \ No newline at end of file diff --git a/Scripts/weather.sh b/Scripts/weather.sh index db62560..ae1abd9 100755 --- a/Scripts/weather.sh +++ b/Scripts/weather.sh @@ -1,7 +1,7 @@ #!/bin/bash # needs work -CITY="Hamburg" +CITY="Volos" # glyphs (TODO) #  day cloud @@ -12,7 +12,7 @@ CITY="Hamburg" #  snow  #  sun #  cloud -#  moon  star +#  moon  star ⏾ another moon #   house #  globe #  bed @@ -22,7 +22,7 @@ CITY="Hamburg" TEMP="$(curl -s -A "Mozilla/5.0" wttr.in/$CITY | grep -m 1 '°C'| awk '{print $(NF-1)}' | cut -d ">" -f2 | cut -f1 -d "<")" -# NOTE: Currently weather state disabled. Uncomment to reenable +# NOTE: Currently weather state disabled (not fully implemented). Uncomment to reenable # STATE="$(curl -s -A "Mozilla/5.0" wttr.in/$CITY | grep -m 1 -B 1 '°C' | sed '$d' | awk '{printf "%s %s", $(NF-1), $NF}')" # PRELAST="$(echo $STATE | awk '{print $1}')" # HOUR="$(date +%H)" @@ -54,7 +54,10 @@ TEMP="$(curl -s -A "Mozilla/5.0" wttr.in/$CITY | grep -m 1 '°C'| awk '{print $( # City+degrees -#echo $CITY $TEMP°C +#echo " $CITY $TEMP°C" # Degrees only -echo "$TEMP°C" \ No newline at end of file +#echo "$TEMP°C" + +# Leaf + degrees +echo "  $TEMP°C" \ No newline at end of file