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:
parent
4bd4536cfd
commit
9b5d9e1186
2 changed files with 12 additions and 5 deletions
11
scripts/watch-mac
Executable file
11
scripts/watch-mac
Executable 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
|
||||
|
|
@ -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)
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue