Code: Select all
jq < ~/.conky/cronograph/accuweather/scripts/../../conk/weather/script/accu/../script/dump.tmp 'temp_maxF'
still completely stabbing in the dark over here though.
looks like you are making progress, good job on that.
Code: Select all
jq < ~/.conky/cronograph/accuweather/scripts/../../conk/weather/script/accu/../script/dump.tmp 'temp_maxF'
I THINK I GOT IT!!!zcot wrote: ⤴Wed Jun 05, 2024 8:44 pm bash line:anything along those lines, it would return that thing. you will have to dig the man to get into subcategories or something.Code: Select all
jq < ~/.conky/cronograph/accuweather/scripts/../../conk/weather/script/accu/../script/dump.tmp 'temp_maxF'
still completely stabbing in the dark over here though.
looks like you are making progress, good job on that.
Code: Select all
#!/bin/bash
# Define the path to the JSON file
json_file="$HOME/.cache/5_day.json"
# Check if the JSON file exists
if [ ! -f "$json_file" ]; then
echo "Error: JSON file not found at $json_file"
exit 1
fi
# Extract the temperature values for the first instance of 2024-06-06
mintemp_f=$(jq -r '.list[] | select(.dt_txt | contains("2024-06-06")) | .main.temp_min' "$json_file" | head -n 1)
maxtemp_f=$(jq -r '.list[] | select(.dt_txt | contains("2024-06-06")) | .main.temp_max' "$json_file" | head -n 1)
# Check if the temperature values are not null
if [ -z "$mintemp_f" ] || [ -z "$maxtemp_f" ]; then
echo "Error: Temperature data not found for 2024-06-06"
exit 1
fi
# Output the result
echo "Minimum temperature in Fahrenheit on 2024-06-06: $mintemp_f"
echo "Maximum temperature in Fahrenheit on 2024-06-06: $maxtemp_f"
contains("2024-06-06"
with some stuff you were using earlier using date
, -this way it just always works based on any given date.I'm stuck! I have display in terminal but not in conky:
Code: Select all
# Define the path to the JSON file
json_file="$HOME/.cache/5_day.json"
# Calculate tomorrow's date in YYYY-MM-DD format
tomorrow_date=$(date +%Y-%m-%d -d "tomorrow")
# Extract the temperature values for tomorrow
mintemp_f=$(jq -r --arg tomorrow "$tomorrow_date" '.list[] | select(.dt_txt | contains($tomorrow)) | .main.temp_min' "$json_file" | head -n 1)
maxtemp_f=$(jq -r --arg tomorrow "$tomorrow_date" '.list[] | select(.dt_txt | contains($tomorrow)) | .main.temp_max' "$json_file" | head -n 1)
# Check if the temperature values are not null
if [ -z "$mintemp_f" ] || [ -z "$maxtemp_f" ]; then
echo "Error: Temperature data not found for $tomorrow_date"
exit 1
fi
# Output the result
echo "${mintemp_f}F/${maxtemp_f}F"
Code: Select all
#!/bin/bash
# Define the path to the JSON file
json_file="$HOME/.cache/5_day.json"
# Calculate the date for the day after daytwo in YYYY-MM-DD format
daytwo_date=$(date +%Y-%m-%d -d "2 days")
# Extract the temperature values for daytwo
daymintemp_f=$(jq -r --arg daytwo "$daytwo_date" '.list[] | select(.dt_txt | contains($daytwo)) | .main.temp_min' "$json_file" | head -n 1)
daymaxtemp_f=$(jq -r --arg daytwo "$daytwo_date" '.list[] | select(.dt_txt | contains($daytwo)) | .main.temp_max' "$json_file" | head -n 1)
# Check if the temperature values are not null
if [ -z "$daymintemp_f" ] || [ -z "$daymaxtemp_f" ]; then
echo "Error: Temperature data not found for $daytwo_date"
exit 1
fi
# Output the result
echo "${daymintemp_f}F/${daymaxtemp_f}F"
Code: Select all
#!/bin/bash
# Define the path to the JSON file
json_file="$HOME/.cache/5_day.json"
# Calculate the date for three days after today in YYYY-MM-DD format
threedays_date=$(date +%Y-%m-%d -d "3 days")
# Extract the temperature values for three days after today
threedaymintemp_f=$(jq -r --arg threedays "$threedays_date" '.list[] | select(.dt_txt | contains($threedays)) | .main.temp_min' "$json_file" | head -n 1)
threedaymaxtemp_f=$(jq -r --arg threedays "$threedays_date" '.list[] | select(.dt_txt | contains($threedays)) | .main.temp_max' "$json_file" | head -n 1)
# Check if the temperature values are not null
if [ -z "$threedaymintemp_f" ] || [ -z "$threedaymaxtemp_f" ]; then
echo "Error: Temperature data not found for $threedays_date"
exit 1
fi
# Output the result
echo "${threedaymintemp_f}F/${threedaymaxtemp_f}F"
Code: Select all
${voffset 20}${goto 90}${font hooge 05_53:size=12}${execi 60 cat ~/.cache/weather.json | jq '.main.temp' | awk '{print int($1+0.5)}'}°F ${font}${goto 180}${execi 60 cat ~/.cache/weather.json | jq -r '.weather[0].main'}${voffset -32}${goto 125}${font conkyweather:size=40}${font}${voffset -12}${goto 185}${voffset 12}${goto 185}${font conkyweather:size=20}${voffset 7}${goto 80}${execp ./temp1.sh}${execp echo "${mintemp_f}/${maxtemp_f}"}${goto 185}${font}${voffset 6}${goto 84}${execp ./temp2.sh}${execp echo "${daymintemp_f}/${daymaxtemp_f}"}${goto 140}${execp ./temp3.sh}${execp echo "${threedaymintemp_f}/${threedaymaxtemp_f}"}${goto 190}${voffset 7}${goto 85}${exec date -d "tomorrow" '+%a'}${goto 140}${exec date -d "+2 days" '+%a'}${goto 190}${exec date -d "+3 days" '+%a'}
${exec ~/.conky/cronograph/accuweather/temp1.sh}${execp $mintemp_f}
I'm stuck my friend.