diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2024-06-20 01:04:36 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2024-06-20 01:04:36 +0800 |
| commit | ea79ffef6e18f74fd995d665a46b84abc5299c52 (patch) | |
| tree | 2aed04d2bcf8b6aa2b8a6d13c0440465b54a3a18 /polybar-temp-autofix.sh | |
| parent | 71f4a9f1b5a53cdcb239dd28ab3a6f1eacc4fe76 (diff) | |
updates
Diffstat (limited to 'polybar-temp-autofix.sh')
| -rwxr-xr-x | polybar-temp-autofix.sh | 32 |
1 files changed, 30 insertions, 2 deletions
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" |
