What you need is a short bash script, like:
while [ 1 ]
if [ "PARAMETER" = "SOMETHING" ]; then
notify-send "Attention" "There is a new connection."
echo "Nothing Found"
Basically, this would listen for a
PARAMETER (How, I don't know...), and when it equals
SOMETHING, then it will send a notification. If the
PARAMETER is not equal to
SOMETHING, it will print
Nothing Found (This is not necessary, it just shows that it is working), wait for 5 seconds, and start again.
The problem is getting it find when it has connected... None of these...
netstat -n -A inet
cat /proc/net/ip_conntrack - apparently deprecated anyway, see here
...seem to produce the parameters required...
Any corrections welcome, especially with the bash script