xps-dots/.config/polybar/launch.sh

24 lines
646 B
Bash
Executable File

#!/usr/bin/env sh
# Terminate already running bar instances
killall -q polybar
# Wait until the processes have been shut down
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
~/.config/polybar/scripts/arch/arch-updates.sh & echo $! > ~/.config/polybar/scripts/arch/arch_updates.pid
# Launch
polybar top &
polybar bottom &
echo "Bar launched..."