I am relatively new to Linux and have been trying to make a udev rule for a while, but without succes. For testing purposes, I have a file /etc/udev/rules.d/80-power.rules which containsACTION==add, RUN+=/opt/eigen_scripts/waarschuwing_stroomkabel.shSupposedly, this should run the specified script whenever a device like a USB stick is added (I monitored udevadm and the action indeed is add when plugging in a USB stick). This is not actually what I want to achieve in the end, but it seemed like the easiest way to at least get some kind of udev rule working. If you think the problem lies here, feel free to suggest an even simpler rule, I'd be glad to get any rule at all working.The script in /opt/eigen_scripts/waarschuwing_stroomkabel.sh isnotify-send -i face-worried Geen stroom! Sluit de adapter aan of de computer valt misschien uit.and should send a notification.Both files mentioned can be read and executed by root and all users. Using bash I have manually run the script in the second file (both as root and as normal user) and it works just fine. I have rebooted the system several times. I don't know what to try anymore. Thank you for your help.I am working on a laptop with Ubuntu 16.04 installed.Update: I have been looking at the duplicate question and the links in the comments, but haven't gotten much wiser. Updating my script to the script#!/bin/bashexport DISPLAY=:0notify-send device pluggedand rebooting did not solve anything, while it did at least partially work for the dupplicate questions's OP. I tried to follow the steps in the first two answers of this question but without effect. And I'm absolutely too much of a newbie to understand what this question is even about. I'm willing to read up on stuff and experiment, but the amount of information is too overwhelming at the moment.
udev action to call notify-send not working
shell script;x11;udev;d bus;notify send