diff --git a/de/home/.config/eww/scripts/home/mcstatus b/de/home/.config/eww/scripts/home/mcstatus index fdace21..76208e5 100755 --- a/de/home/.config/eww/scripts/home/mcstatus +++ b/de/home/.config/eww/scripts/home/mcstatus @@ -3,20 +3,22 @@ cache_path="${HOME}/.cache/mcstatus" mcstatus_cache="${cache_path}/mcstatus.json" mkdir -p "${cache_path}" -server_list=("mc.pogmom.me" "mc.pogmom.me") +server_list=("mc.pogmom.me" "ian.hotn.gay") update_cache_json(){ - for s in "${server_list[@]}";do - mcstatus "${s}" json | jq '. += {"address":"'"${s}"'","icon_path":"'"${cache_path}/${s}"'.png"}' - done | jq -n '[inputs]' | tee "${mcstatus_cache}" >/dev/null - jq -rc '.[] | "\(.address) \(.status.icon)"' ~/.cache/mcstatus.json | while read name icon;do - echo "${icon/*base64,/}" | base64 --decode > "${cache_path}/${name}.png" +# for s in "${server_list[@]}";do +# mcstatus "${s}" json | jq '. += {"address":"'"${s}"'","icon_path":"'"${cache_path}/${s}"'.png"}' +# done | jq -n '[inputs]' | tee "${mcstatus_cache}" >/dev/null + jq -rc '.[] | "\(.address) \(.status.icon)"' "${mcstatus_cache}" | while read name icon;do + echo "${name}" + echo "${icon/*base64,/}" +# echo "${icon/*base64,/}" | base64 --decode > "${cache_path}/${name}.png" done } -if [[ ! $(find "${mcstatus_cache}" -cmin -60 -print 2>/dev/null) ]]; then +#if [[ ! $(find "${mcstatus_cache}" -cmin -15 -print 2>/dev/null) ]]; then update_cache_json -fi +#fi -cat "${mcstatus_cache}" +#cat "${mcstatus_cache}"