This commit is contained in:
jonathan.wyss
2025-09-11 21:11:06 +02:00
parent 1faa99bf48
commit b59bacda5c
3 changed files with 21 additions and 0 deletions

5
notify-disk-space Executable file
View File

@@ -0,0 +1,5 @@
#!/usr/bin/env bash
#export DBUS_SESSION_BUS_ADDRESS="${DBUS_SESSION_BUS_ADDRESS:-unix:path=/run/user/${UID}/bus}"
#export DISPLAY=:0
for i in $(df --output=pcent);do per=${i%*\%} ;if [ $per -gt 85 ] ;then notify-send "Check diskspace!" ;fi ;done

View File

@@ -0,0 +1,6 @@
[Unit]
Description=Check for disk space usage
[Service]
Type=simple
ExecStart=/usr/bin/notify-disk-space

10
notify-disk-space.timer Normal file
View File

@@ -0,0 +1,10 @@
[Unit]
Description=Check disk usage periodically
[Timer]
OnBootSec=5min
OnUnitActiveSec=10min
Unit=notify-disk-space.service
[Install]
WantedBy=timers.target