My tmux.conf uses three shell scripts to show system usage, CPU/GPU/HDD temperatures, and current weather on the right-side of the tmux statusline (image attached). I'd like to use different status-interval times for each of these scripts, if possible. In particular, I'd like the API calls to OpenWeatherMap, managed by the weather.sh script, to be updated every 10min (OpenWeatherMap's default update time), and the other two, managed by sysload.sh and systemp.sh, to be updated every 5sec. Right now I have a single status-interval of 60sec declared at the top of the statusline script, which updates the entire statusline every 1min - not what I want. The relevant portion of the tmux.conf is pasted below. Any help is appreciated. Thanks!
set -g status-interval 60
...rest of statusline codes...
set -g status-right "#[fg=green,bg=default,bright]#($HOME/.config/tmux/sysload.sh)"
set -ag status-right "#[fg=grey80,bg=default,bright] | "
set -ag status-right "#[fg=pink3,bg=default,bright]#($HOME/.config/tmux/systemp.sh)"
set -ag status-right "#[fg=grey80,bg=default,bright] | "
set -ag status-right "#[fg=#7aa2f7,bg=default,bright]#($HOME/.config/tmux/weather.sh)"
set -ag status-right "#[fg=grey80,bg=default,bright] | "
set -ag status-right "#[fg=#565f89,bg=default]%b %d (%a) %H:%M#[default]"
UPDATE: I've attempted the following changes to this code: removed the status-interval line at the top, and added --interval <n> after the script name in each line. I'm not sure if this is correct though:
set -g status-right "#[fg=green,bg=default,bright]#($HOME/.config/tmux/sysload.sh --interval 5)"
set -ag status-right "#[fg=grey80,bg=default,bright] | "
set -ag status-right "#[fg=pink3,bg=default,bright]#($HOME/.config/tmux/systemp.sh --interval 5)"
set -ag status-right "#[fg=grey80,bg=default,bright] | "
set -ag status-right "#[fg=#7aa2f7,bg=default,bright]#($HOME/.config/tmux/weather.sh --interval 600)"
set -ag status-right "#[fg=grey80,bg=default,bright] | "
set -ag status-right "#[fg=#565f89,bg=default]%b %d (%a) %H:%M#[default]"
UPDATE#2: I followed Jeremy's suggestion in the comment below to cache weather script's output every 10min interval, which solves the problem.
