Can't get what's wrong with my udev rule and bash script. I want to make simple test on usb device insertion.
This is my rule /etc/udev/rules.d/90-usb.rules
:
ACTION=="add", RUN+="/home/mike/notification.sh"
And this is my script /home/mike/notification.sh
:
#!/bin/bash
echo 'message:Hello!' | zenity --notification --listen
Just from terminal this command works fine.
chmod +x /home/mike/notification.sh
? – kenn Oct 17 '17 at 11:35/home/mike/notification.sh
and it works, but with udev it doesn't. – mr.incredible Oct 17 '17 at 11:42ACTION=="add", RUN+="/home/mike/notification.sh"
, so it should trigger the command on add event. Correct me if i wrong, please. – mr.incredible Oct 17 '17 at 12:38/lib/udev
– kenn Oct 17 '17 at 12:40udev
redirection as @user.dz suggested in the above link. – kenn Oct 17 '17 at 12:46ACTION=="add", RUN+="/bin/sh /home/mike/notification.sh"
– kenn Oct 17 '17 at 12:51