In case anyone comes up with a reason that only some commands within the script run when it is called from a udev rule, maybe you will post it here.
I have now tried the following script, called when the rule is triggered ...
zenity --info --text " Hello Homey "
echo Hello Homey >/home/user/q
The result is that /home/user/q gets written to but Zenity is not launched.
Naturally when running the script from a terminal both commands are executed.
So the question is ..... why one command is executed and the other not?
Thanks for any feedback
My guess is that zenity, being a graphical tool, requires the DISPLAY environment to be set. Since UDEV runs from the equivalent of a console, the shell spawned by UDEV also doesn't have that environment variable set, hence no popup.