From b2a9b66991e6de325fc86dedca8374f77fb1e518 Mon Sep 17 00:00:00 2001 From: Penelope Gwen Date: Thu, 9 Oct 2025 13:15:01 -0700 Subject: [PATCH] New backup 2025-10-09 13:15:01 --- de/home/.config/eww/scripts/home/mcstatus | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 de/home/.config/eww/scripts/home/mcstatus diff --git a/de/home/.config/eww/scripts/home/mcstatus b/de/home/.config/eww/scripts/home/mcstatus new file mode 100644 index 0000000..42a2e7e --- /dev/null +++ b/de/home/.config/eww/scripts/home/mcstatus @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +mcstatus_cache="${HOME}/.cache/mcstatus.json" + +if [[ ! $(find "${mcstatus_cache}" -cmin -15 -print 2>/dev/null) ]]; then + if ! ping -w 15 -c 1 wttr.in;then + exit + fi + wttr_json=$(curl --silent wttr.in/Eugene?format=j1) + if [ "" != "${wttr_json}" ]; then + echo "${wttr_json}" | tee "${wttr_cache}" + fi +fi