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}" "$@" >&2
}

post_install() {
  msg "Attempting to enable driver workaround for SYNA3602 touchpad..."
  systemctl is-active mhwd-i2c-syna3602 >/dev/null || systemctl enable mhwd-i2c-syna3602
  systemctl is-active mhwd-i2c-syna3602 >/dev/null || systemctl reload mhwd-i2c-syna3602
  echo ""
  msg "Driver workaround for SYNA3602 touchpad should now be enabled."
  echo ""
}

post_remove() {
  msg "Attempting to disable Samba services..."
  ! systemctl is-active mhwd-i2c-syna3602 >/dev/null || systemctl disable mhwd-i2c-syna3602
  echo ""
  msg "Driver workaround for SYNA3602 touchpad should now be disabled. Reboot your system."
  echo ""
}
