From 8748783b6062a1936aa618bae5ef4d5e7452640d Mon Sep 17 00:00:00 2001 From: Ethan Edwards Date: Sun, 20 Jun 2021 22:02:57 -0400 Subject: [PATCH] Fix for immutable Nix store --- scripts/sleep_weather.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/sleep_weather.sh b/scripts/sleep_weather.sh index 4ce6019..621ff8d 100755 --- a/scripts/sleep_weather.sh +++ b/scripts/sleep_weather.sh @@ -8,6 +8,7 @@ fahrenheit=$1 location=$2 LOCKFILE=/tmp/.dracula-tmux-weather.lock +DATAFILE=/tmp/.dracula-tmux-data ensure_single_process() { @@ -22,15 +23,15 @@ main() current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - if [ ! -f $current_dir/../data/weather.txt ]; then - printf "Loading..." > $current_dir/../data/weather.txt + if [ ! -f $DATAFILE ]; then + printf "Loading..." > $DATAFILE fi - $current_dir/weather.sh > $current_dir/../data/weather.txt + $current_dir/weather.sh > $DATAFILE while tmux has-session &> /dev/null do - $current_dir/weather.sh $fahrenheit $location > $current_dir/../data/weather.txt + $current_dir/weather.sh $fahrenheit $location > $DATAFILE if tmux has-session &> /dev/null then sleep 1200