pacman’s cache strikes again
~/.config/fsniper/scripts/pacman-cache.sh
#!/bin/bash
# This script checks the pacman cache directory and runs a command if it is over a certain size.
MAXSIZE="3500" # run the command you if the cache is over this size (in mb)
# run this command if CACHE is > MAXSIZE
COMMAND="echo \"oh no pacman's cache is over $MAXSIZE\" | mail -s \"pacman warning\" me@gmail.com "
CACHE="/var/cache/pacman/pkg" # cache location
if [[ "`du -sm $CACHE`" > "$MAXSIZE" ]]; then
$COMMAND
fi
and in ~/.config/fsniper/config
/var/cache/pacman/pkg/ {
* {
handler = pacman-cache.sh %%
}