#!/bin/bash

round() {
    printf "%.${2:-0}f" "$1"
}

temp_liquid=$(echo "$(sensors | grep 'Coolant' | awk '{print $2}' | cut -c 2-)")
temp_liquid=$(round $temp_liquid 0)°C

# temp_liquid=$(echo "$(liquidctl status | grep 'Liquid' | awk '{print $4}')°C")

rpm_fan=$(echo "$(sensors | grep 'Fan' | awk '{print $2}')RPM")
# rpm_fan=$(echo "$(liquidctl status | grep 'Fan' | awk '{print $4}')RPM")
rpm_pump=$(echo "$(sensors | grep 'Pump' | awk '{print $2}')RPM")
# rpm_pump=$(echo "$(liquidctl status | grep 'Pump' | awk '{print $4}')RPM")

# echo "LIQUID  $temp_liquid  FAN $rpm_fan  PUMP $rpm_pump"
# echo "KRAKEN  $temp_liquid  FAN $rpm_fan  PUMP $rpm_pump"
# echo "$temp_liquid  󰈐 $rpm_fan  󱐂 $rpm_pump"

[[ "$rpm_fan" =~ ^4* || "$rpm_fan" =~ ^5* ]] && echo "" && exit

echo "$temp_liquid   󰈐 $rpm_fan"

#
