hwmon-path/polybar to env

This commit is contained in:
Harri Lahtinen 2020-05-13 18:50:37 +03:00
parent faaf205da7
commit f9dcd9410a
2 changed files with 9 additions and 1 deletions

View File

@ -230,7 +230,8 @@ label-background = ${colors.color4}
[module/temperature] [module/temperature]
type = internal/temperature type = internal/temperature
thermal-zone = 6 thermal-zone = 6
hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon5/temp1_input #hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon6/temp1_input
hwmon-path = ${env:HWMON_PATH}
warn-temperature = 65 warn-temperature = 65
format = <ramp> <label> format = <ramp> <label>
format-underline = ${colors.foreground} format-underline = ${colors.foreground}

View File

@ -6,6 +6,13 @@ killall -q polybar
# Wait until the processes have been shut down # Wait until the processes have been shut down
while pgrep -x polybar >/dev/null; do sleep 1; done while pgrep -x polybar >/dev/null; do sleep 1; done
# Set hwmon-path
for i in /sys/devices/platform/coretemp.0/hwmon/hwmon*/temp*_input; do
if [ "$(<$(dirname $i)/name): $(cat ${i%_*}_label 2>/dev/null || echo $(basename ${i%_*}))" = "coretemp: Package id 0" ]; then
export HWMON_PATH="$i"
fi
done
# Launch arch_updates script # Launch arch_updates script
~/.config/polybar/scripts/arch/arch-updates.sh & echo $! > ~/.config/polybar/scripts/arch/arch_updates.pid ~/.config/polybar/scripts/arch/arch-updates.sh & echo $! > ~/.config/polybar/scripts/arch/arch_updates.pid