Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions meta-opencentauri/images/cosmos-image-base.bb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ CORE_IMAGE_EXTRA_INSTALL += "\
afc \
tmc-autotune \
dragonbreath \
check-disk \
"

INITRAMFS_IMAGE = "core-image-tiny-initramfs"
Expand Down
14 changes: 13 additions & 1 deletion meta-opencentauri/recipes-apps/klipper/files/shell.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,16 @@ initial_duration: 60
gcode:
{% if printer.idle_timeout.state in ["Idle", "Ready"] and printer.print_stats.state == "standby" %}
RUN_SHELL_COMMAND CMD=CHECK_FOR_UPDATES
{% endif %}
{% endif %}

[gcode_shell_command CHECK_DISK]
command: check-disk
timeout: 5
verbose: True

[delayed_gcode check_disk_startup]
initial_duration: 60
gcode:
RUN_SHELL_COMMAND CMD=CHECK_DISK


21 changes: 21 additions & 0 deletions meta-opencentauri/recipes-data/check-disk/check-disk_0.1.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
DESCRIPTION = "COSMOS Disk Space Checker"
LICENSE = "GPL-3.0-only"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-3.0-only;md5=c79ff39f19dfec6d293b95dea7b07891"

SRC_URI = "file://check-disk.sh"

inherit allarch

RDEPENDS:${PN} = " \
curl \
screen-actions \
"

do_install[vardeps] += "DISTRO_VERSION"

do_install() {
install -d ${D}${bindir}
install -m 0755 ${UNPACKDIR}/check-disk.sh ${D}${bindir}/check-disk
}

FILES:${PN} = "${bindir}/check-disk"
15 changes: 15 additions & 0 deletions meta-opencentauri/recipes-data/check-disk/files/check-disk.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh

ALERTS=""
while read -r line; do
if [ -n "$line" ]; then
ALERTS="${ALERTS}${line}. "
fi
done < <(df -P /user-resource /board-resource | awk 'NR>1 {sub(/%/, "", $5); if ($5 > 90) print $6 " is at " $5 "%"}')

if [ -n "$ALERTS" ]; then
uiprompt "Disk Space Warning" "ALERT: ${ALERTS}"
fi



Loading