From 3648465c33b9b5487cf4bf5970765cf0c430d73a Mon Sep 17 00:00:00 2001 From: Gregory Pakosz Date: Mon, 7 Sep 2020 15:57:58 +0200 Subject: [PATCH] added a sleep call to the wttr.in example to throttle network requests, closes #297 --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2b4c069..84de36b 100644 --- a/README.md +++ b/README.md @@ -278,8 +278,10 @@ Beside custom variables mentioned above, the `tmux_conf_theme_status_left` and `#()` to call an external command that inserts weather information provided by [wttr.in]: ``` -tmux_conf_theme_status_right='#{prefix}#{pairing}#{synchronized} #(curl wttr.in?format=3) , %R , %d %b | #{username}#{root} | #{hostname} ' +tmux_conf_theme_status_right='#{prefix}#{pairing}#{synchronized} #(curl -m 1 wttr.in?format=3 2>/dev/null; sleep 900) , %R , %d %b | #{username}#{root} | #{hostname} ' ``` +The `sleep 900` call makes sure the network request is issued at most every 15 +minutes whatever the value of `status-interval`. ![Weather information from wttr.in](https://user-images.githubusercontent.com/553208/52175490-07797c00-27a5-11e9-9fb6-42eec4fe4188.png)