err() {
    ALL_OFF="\e[1;0m"
    BOLD="\e[1;1m"
    RED="${BOLD}\e[1;31m"
    local mesg=$1; shift
    printf "${RED}==>${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2
}

msg() {
    ALL_OFF="\e[1;0m"
    BOLD="\e[1;1m"
    GREEN="${BOLD}\e[1;32m"
    local mesg=$1; shift
    printf "${GREEN}==>${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2
}

post_install() {
    mhwd-gpu --check
    echo "If you run into trouble with CUDA not being available, run nvidia-modprobe first."
    echo "If you use GDM on Wayland, you might have to run systemctl enable --now nvidia-resume.service"
}

post_upgrade() {
    post_install
}

post_remove() {
    mhwd-gpu --check
}
