From a6cda45c5bbd3301195554691977fc7deaab5e6b Mon Sep 17 00:00:00 2001 From: pfych Date: Fri, 1 Aug 2025 08:29:39 +1000 Subject: [PATCH] Dont pass resolved value --- .config/scripts/util/taskbar.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.config/scripts/util/taskbar.sh b/.config/scripts/util/taskbar.sh index bb621bb..bec0bf6 100755 --- a/.config/scripts/util/taskbar.sh +++ b/.config/scripts/util/taskbar.sh @@ -10,16 +10,16 @@ debounce () { FALLBACK=$4 if [ ! -f "/tmp/debounce-$VAR_NAME" ]; then - VAR_REFERENCE="$FUNCTION" + VAR_REFERENCE="$($FUNCTION)" echo "$(date +%s)" > "/tmp/debounce-$VAR_NAME" else LAST_CHECK=$(cat "/tmp/debounce-$VAR_NAME") if [ $(($NOW - $LAST_CHECK)) -gt $DEBOUNCE_TIME ]; then - VAR_REFERENCE="$FUNCTION" + VAR_REFERENCE="$($FUNCTION)" echo "$(date +%s)" > "/tmp/debounce-$VAR_NAME" else - VAR_REFERENCE="$FALLBACK" + VAR_REFERENCE="$($FALLBACK)" fi fi } @@ -69,19 +69,19 @@ get_temps () { } debounce MOUSE_STRING 3600 \ - "$(get_mouse_text)" \ - "$(cat /tmp/last-mouse-level || get_mouse_text)"; + "get_mouse_text" \ + "cat /tmp/last-mouse-level || get_mouse_text"; debounce MONERO_STRING 60 \ - "$(get_monero_text)" \ - "$(cat /tmp/last-monero-value || get_monero_text)"; + "get_monero_text" \ + "cat /tmp/last-monero-value || get_monero_text"; debounce DATE_STRING 5 \ - "$(get_date)" \ - "$(cat /tmp/last-date || get_date)"; + "get_date" \ + "cat /tmp/last-date || get_date"; debounce TEMP_STRING 5 \ - "$(get_temps)" \ - "$(cat /tmp/last-temp || get_temps)" + "get_temps" \ + "cat /tmp/last-temp || get_temps" echo " $TEMP_STRING | $MOUSE_STRING | $MONERO_STRING | $DATE_STRING"