Avoid using the unicode degree symbol under macOS
* The (home)brew watch command butchers the unicode?
This commit is contained in:
parent
e3d0902c45
commit
4bd4536cfd
1 changed files with 5 additions and 1 deletions
|
|
@ -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,
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue