#!/bin/sh
c=$(/opt/firefox-bin-ru/firefox -v | awk '{print $3}')
l=$(curl -s https://product-details.mozilla.org/1.0/firefox_versions.json | awk -F'"' '/LATEST_FIREFOX_VERSION/ {print $4}')
case ${LANG:-} in
  ru*) msg="Firefox $c устарел. Доступна версия: $l." ;;
  *)   msg="Firefox $c is outdated. Latest version: $l." ;;
esac
[ "$l" = "$c" ] || notify-send -i firefox "$msg" &
if [ -f /usr/lib/libpulse.so ]; then
  exec /opt/firefox-bin-ru/firefox --class "Firefox" --name "Firefox" "$@"
else
  exec apulse /opt/firefox-bin-ru/firefox --class "Firefox" --name "Firefox" "$@"
fi
