Added watch-mac and reverted previous commit

* This allows the degree symbol to be displayed correctly
  * (At least in iTerm2)
This commit is contained in:
2Shirt 2019-11-12 10:36:34 -07:00
parent 4bd4536cfd
commit 9b5d9e1186
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C
2 changed files with 12 additions and 5 deletions

11
scripts/watch-mac Executable file
View file

@ -0,0 +1,11 @@
#!/bin/zsh
#
## watch-like utility
WATCH_FILE="${1}"
while :; do
echo -n "\e[100A"
cat "${WATCH_FILE}"
sleep 1s
done

View file

@ -304,7 +304,6 @@ def get_sensor_data_macos():
def get_temp_str(temp, colored=True):
"""Get colored string based on temp, returns str."""
degree_symbol = '*' if platform.system() == 'Darwin' else '°'
temp_color = None
# Safety check
@ -322,10 +321,7 @@ def get_temp_str(temp, colored=True):
break
# Done
return color_string(
f'{"-" if temp < 0 else ""}{temp:2.0f}{degree_symbol}C',
temp_color,
)
return color_string(f'{"-" if temp < 0 else ""}{temp:2.0f}°C', temp_color)