Created
October 23, 2014 02:42
-
-
Save anonymous/938b3dd73a611d462baa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/Applications/TemperatureMonitor.app/Contents/MacOS/tempmonitor -a -l -f | while read reading; do | |
set -- $reading; | |
temperature="${@:$[$#-1]:1}"; | |
sensor="${@:2:$[$#-3]}"; | |
sensor="${sensor:0:$[${#sensor}-1]}"; | |
sensor="${sensor//(}"; | |
sensor="${sensor//)}"; | |
sensor="$(echo "${sensor:0:32}" | tr '[:lower:]' '[:upper:]')"; | |
short=$[32-${#sensor}]; | |
i=0; | |
while ((i++ < short)); do sensor="$sensor "; done; | |
echo "$sensor"$' \e[35m'"${temperature}°F"$'\e[0m'; | |
done; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment