diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2024-05-18 19:10:00 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2024-05-18 19:10:00 +0800 |
| commit | 865961a698ba0cce4943cf08d03d0017048cd67e (patch) | |
| tree | 0710fd8fa3f865ebe772ac6d7b87b23a57ca3ad2 /polybar-temp-autofix.sh | |
| parent | c0bad17912fe48e0b8719f8c42e9193a0bc6f71f (diff) | |
updates
Diffstat (limited to 'polybar-temp-autofix.sh')
| -rwxr-xr-x | polybar-temp-autofix.sh | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/polybar-temp-autofix.sh b/polybar-temp-autofix.sh index e18a77a..e34a20d 100755 --- a/polybar-temp-autofix.sh +++ b/polybar-temp-autofix.sh @@ -1,13 +1,13 @@ #!/usr/bin/bash -if [[ -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 +if [[ -e /sys/devices/platform/coretemp.0/hwmon/hwmon5 && $(grep -i "hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon4/temp1_input" /home/system/.config/polybar/modules.ini) ]]; then + printf "fixing hwmon4 to hwmon5\n" + sed -i 's#hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon4/temp1_input#hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon5/temp1_input#g' /home/system/.config/polybar/modules.ini exit 0 -elif [[ -e /sys/devices/platform/coretemp.0/hwmon/hwmon4 && $(grep -i "hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon3/temp1_input" /home/system/.config/polybar/modules.ini) ]]; then - printf "fixing hwmon3 to hwmon4\n" - sed -i 's#hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon3/temp1_input#hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon4/temp1_input#g' /home/system/.config/polybar/modules.ini +elif [[ -e /sys/devices/platform/coretemp.0/hwmon/hwmon4 && $(grep -i "hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon5/temp1_input" /home/system/.config/polybar/modules.ini) ]]; then + 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/hwmon3 && $(grep -i "hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon3/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 +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" exit 0 else |
