From ea79ffef6e18f74fd995d665a46b84abc5299c52 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Thu, 20 Jun 2024 01:04:36 +0800 Subject: updates --- polybar-temp-autofix.sh | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) (limited to 'polybar-temp-autofix.sh') diff --git a/polybar-temp-autofix.sh b/polybar-temp-autofix.sh index e34a20d..642b458 100755 --- a/polybar-temp-autofix.sh +++ b/polybar-temp-autofix.sh @@ -7,8 +7,36 @@ elif [[ -e /sys/devices/platform/coretemp.0/hwmon/hwmon4 && $(grep -i "hwmon-pat printf "fixing hwmon5 to hwmon4\n" sed -i 's#hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon5/temp1_input#hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon4/temp1_input#g' /home/system/.config/polybar/modules.ini exit 0 -elif [[ -e /sys/devices/platform/coretemp.0/hwmon/hwmon5 && $(grep -i "hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon5/temp1_input" /home/system/.config/polybar/modules.ini) || -e /sys/devices/platform/coretemp.0/hwmon/hwmon4 && $(grep -i "hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon4/temp1_input" /home/system/.config/polybar/modules.ini) ]]; then - printf "Nothing left to fix\n" +elif [[ -e /sys/devices/platform/coretemp.0/hwmon/hwmon3 && $(grep -i "hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon4/temp1_input" /home/system/.config/polybar/modules.ini) ]]; then + printf "fixing hwmon4 to hwmon3\n" + sed -i 's#hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon4/temp1_input#hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon3/temp1_input#g' /home/system/.config/polybar/modules.ini + exit 0 +elif [[ -e /sys/devices/platform/coretemp.0/hwmon/hwmon3 && $(grep -i "hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon5/temp1_input" /home/system/.config/polybar/modules.ini) ]]; then + printf "fixing hwmon5 to hwmon3\n" + sed -i 's#hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon5/temp1_input#hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon3/temp1_input#g' /home/system/.config/polybar/modules.ini + exit 0 +elif [[ -e /sys/devices/platform/coretemp.0/hwmon/hwmon3 && $(grep -i "hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon6/temp1_input" /home/system/.config/polybar/modules.ini) ]]; then + printf "fixing hwmon6 to hwmon3\n" + sed -i 's#hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon6/temp1_input#hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon3/temp1_input#g' /home/system/.config/polybar/modules.ini + exit 0 +elif [[ -e /sys/devices/platform/coretemp.0/hwmon/hwmon3 && $(grep -i "hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon7/temp1_input" /home/system/.config/polybar/modules.ini) ]]; then + printf "fixing hwmon7 to hwmon3\n" + sed -i 's#hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon7/temp1_input#hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon3/temp1_input#g' /home/system/.config/polybar/modules.ini + exit 0 +elif [[ -e /sys/devices/platform/coretemp.0/hwmon/hwmon5 && $(grep -i "hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon5/temp1_input" /home/system/.config/polybar/modules.ini) ]]; then + printf "hwmon5 is already set\n" + exit 0 +elif [[ -e /sys/devices/platform/coretemp.0/hwmon/hwmon4 && $(grep -i "hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon4/temp1_input" /home/system/.config/polybar/modules.ini) ]]; then + printf "hwmon4 is already set\n" + exit 0 +elif [[ -e /sys/devices/platform/coretemp.0/hwmon/hwmon3 && $(grep -i "hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon3/temp1_input" /home/system/.config/polybar/modules.ini) ]]; then + printf "hwmon3 is already set\n" + exit 0 +elif [[ -e /sys/devices/platform/coretemp.0/hwmon/hwmon6 && $(grep -i "hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon6/temp1_input" /home/system/.config/polybar/modules.ini) ]]; then + printf "hwmon6 is already set\n" + exit 0 +elif [[ -e /sys/devices/platform/coretemp.0/hwmon/hwmon7 && $(grep -i "hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon7/temp1_input" /home/system/.config/polybar/modules.ini) ]]; then + printf "hwmon7 is already set\n" exit 0 else printf "ERROR had occured\n" -- cgit v1.2.3