New backup 2025-10-09 17:00:02
This commit is contained in:
parent
644e83454f
commit
682d634196
2 changed files with 1 additions and 23 deletions
|
@ -19,7 +19,7 @@
|
|||
(for server in json
|
||||
(box
|
||||
:class 'mc_server'
|
||||
:style 'background-image: url("${server.status.icon}");'
|
||||
:style 'background-image: url("/home/${USER}/.cache/mcstatus/${server.status.name}.png");'
|
||||
:orientation 'v'
|
||||
(label
|
||||
:text "${server.address}"
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
cache_path="${HOME}/.cache/mcstatus"
|
||||
mcstatus_cache="${cache_path}/mcstatus.json"
|
||||
mkdir -p "${cache_path}"
|
||||
server_list=("mc.pogmom.me" "mc.pogmom.me")
|
||||
|
||||
update_cache_json(){
|
||||
|
||||
for s in "${server_list[@]}";do
|
||||
mcstatus "${s}" json | jq '. += {"address":"'"${s}"'"}'
|
||||
done | jq -n '[inputs]' | tee "${mcstatus_cache}" >/dev/null
|
||||
jq -rc '.[] | "\(.address) \(.status.icon)"' ~/.cache/mcstatus.json | while read name icon;do
|
||||
base64 --decode "${icon/*base64,/}" | tee "${cache_path}/${name}.png"
|
||||
done
|
||||
}
|
||||
|
||||
if [[ ! $(find "${mcstatus_cache}" -cmin -60 -print 2>/dev/null) ]]; then
|
||||
update_cache_json
|
||||
fi
|
||||
|
||||
#cat "${mcstatus_cache}"
|
Loading…
Add table
Reference in a new issue