I would like a zenity
dialog popup to ask me if I would like to run a backup, when I attached a specific external drive.
Unfortunately, I am having trouble with the UDEV rule syntax. I've got this rule in /etc/udev/rules.d/test.rules
:
ACTION=="add", ATTRS{manufacturer}=="Western Digital", ATTRS{idVendor}=="1058", ATTRS{idProduct}=="1140", RUN+="/usr/local/bin/test.sh"
It's pretty basic, but:
- It gets triggered a dozen times in stead of once.
- It cannot 'speak' using
zenity
whentest.sh
goessudo -Hu <username> zenity --warning --text="Just some random text for now."
because udev is tucked away in the system and cannot find the window manager: Gtk-WARNING **: cannot open display: - It's not very edit-friendly, I wish there were some kind of rule where I can just type the LABEL for certain partitions on which I would like to trigger certain scripts.
I would like to see a general improvement for the UDEV rule, because apart from the many questions and answers about it, here and elsewhere, they all seem a bit different from each other and most of them trigger multiple times.
But most importantly, how, in any way, can I make the connection from here to a script in my home that has access to stuff like my session and my screen so that zenity
can work?