From 9b5d9e1186b51682d6e59f61c4a6965affc033a3 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Tue, 12 Nov 2019 10:36:34 -0700 Subject: [PATCH] Added watch-mac and reverted previous commit * This allows the degree symbol to be displayed correctly * (At least in iTerm2) --- scripts/watch-mac | 11 +++++++++++ scripts/wk/hw/sensors.py | 6 +----- 2 files changed, 12 insertions(+), 5 deletions(-) create mode 100755 scripts/watch-mac diff --git a/scripts/watch-mac b/scripts/watch-mac new file mode 100755 index 00000000..81029734 --- /dev/null +++ b/scripts/watch-mac @@ -0,0 +1,11 @@ +#!/bin/zsh +# +## watch-like utility + +WATCH_FILE="${1}" + +while :; do + echo -n "\e[100A" + cat "${WATCH_FILE}" + sleep 1s +done diff --git a/scripts/wk/hw/sensors.py b/scripts/wk/hw/sensors.py index dcf2ca43..7307818b 100644 --- a/scripts/wk/hw/sensors.py +++ b/scripts/wk/hw/sensors.py @@ -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)