From 4bd4536cfdc2645ffb3e3c58883b5bd1e21fe6cd Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Mon, 11 Nov 2019 23:57:48 -0700 Subject: [PATCH] Avoid using the unicode degree symbol under macOS * The (home)brew watch command butchers the unicode? --- scripts/wk/hw/sensors.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/wk/hw/sensors.py b/scripts/wk/hw/sensors.py index 7307818b..dcf2ca43 100644 --- a/scripts/wk/hw/sensors.py +++ b/scripts/wk/hw/sensors.py @@ -304,6 +304,7 @@ 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 @@ -321,7 +322,10 @@ def get_temp_str(temp, colored=True): break # Done - return color_string(f'{"-" if temp < 0 else ""}{temp:2.0f}°C', temp_color) + return color_string( + f'{"-" if temp < 0 else ""}{temp:2.0f}{degree_symbol}C', + temp_color, + )