Originally Posted by
jansch75
(...) This is a good indication (I guess?) that udev has properly started the script but somehow could not find the right display to show the zenity icon...
Well, here it works like a charm! Try adding & after the zenity command or reloading the udev rules with:
Code:
sudo udevadm control reload_rules
Originally Posted by
jansch75
Anyone, who knows how to start gui windows, icons, messages in a script which will be started by an udev rule??? I have googled a lot, but none of the solutions could help me...
You gave me the first tip by adding this to the beggining some script started by udev:
Code:
#!/bin/bash
set -x
xhost local:MYUSERNAME
export DISPLAY=:0.0
But your zenity icon was executed with root privileges. So if you wanna run some GUI app with your user privileges, you run it this way:
Code:
su MYUSERNAME -c '/usr/bin/some-gui-app arg1 arg2 etc'
Originally Posted by
jansch75
Another (not so urgent) problem: The icon should be shown on the screen as long the hard drive is plugged into my computer. According to the informations about udev, udev will be stopped as long as the script runs... How can I detach the script that it does not block udev as long as the hard drive is plugged into my computer...???
The zenity icon is showed until you click it, so you could add some udev rule to remove the zenity icon after you detach your drive, something like:
Code:
ACTION=="remove", <YOUR HARD DRIVE RULE>, RUN+="/usr/bin/kill -9 $PID_ZENITY"
[]'s
Bookmarks