diff options
| author | Luke Smith <luke@lukesmith.xyz> | 2020-05-04 20:38:38 -0400 |
|---|---|---|
| committer | Luke Smith <luke@lukesmith.xyz> | 2020-05-04 20:38:38 -0400 |
| commit | d20ba524040a08ccb7c00db46db94db9600a861e (patch) | |
| tree | 92c1ef85f3fc539e4e78959473a0892d1f2f2af9 /.local/bin/statusbar/weather | |
| parent | 674f8e1a7a17720031ae7ac66051d6c117363bd9 (diff) | |
| download | eibhear-d20ba524040a08ccb7c00db46db94db9600a861e.tar.gz eibhear-d20ba524040a08ccb7c00db46db94db9600a861e.tar.zst eibhear-d20ba524040a08ccb7c00db46db94db9600a861e.zip | |
wrap less, ping is unnecessary
Diffstat (limited to '.local/bin/statusbar/weather')
| -rwxr-xr-x | .local/bin/statusbar/weather | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/.local/bin/statusbar/weather b/.local/bin/statusbar/weather index a2ec518..68d30a3 100755 --- a/.local/bin/statusbar/weather +++ b/.local/bin/statusbar/weather @@ -6,8 +6,7 @@ # If we have internet, get a weather report from wttr.in and store it locally. # You could set up a shell alias to view the full file in a pager in the # terminal if desired. This function will only be run once a day when needed. -getforecast() { ping -q -c 1 1.1.1.1 >/dev/null && -curl -sf "wttr.in/$LOCATION" > "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" || exit 1 ;} +getforecast() { curl -sf "wttr.in/$LOCATION" > "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" || exit 1 ;} # Some very particular and terse stream manipulation. We get the maximum # precipication chance and the daily high and low from the downloaded file and @@ -18,7 +17,7 @@ sed '13q;d' "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" | grep -o "m\\( # The BLOCK_BUTTON bloat for clicking in i3. case $BLOCK_BUTTON in - 1) setsid "$TERMINAL" -e less -Srf "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" & ;; + 1) setsid "$TERMINAL" -e less -Sf "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" & ;; 2) getforecast && showweather ;; 3) notify-send "🌈 Weather module" "\- Left click for full forecast. - Middle click to update forecast. |
