Hi
How can i run a script when I plug any USB device.
Since I am using LXDE, mount and unmouting does not show notification like in Caja filemanager of MATE.
Added a rule in /etc/udev/rules.d/custom.rule like
ACTION=="add", KERNEL=="sd?", SUBSYSTEMS=="usb", RUN+="/bin/sh -c /usr/share/mx-usb-unmounter"
But below URL says this will not work since udev is creating this process.
https://askdev.io/questions/248884/how- ... ce-plug-in
It can work with "at now" command and how to install it in porteus.
thanks
Run custom scripts upon USB device plug-in
Run custom scripts upon USB device plug-in
Found the way we have to add -u guest and DISPLAY=:0
ACTION=="remove", ENV{ID_PART_TABLE_TYPE}!="", ENV{DEVTYPE}=="partition", RUN+="/usr/bin/sudo -u guest DISPLAY=:0 /usr/bin/Usb-Poweroff.sh"
ACTION=="remove", ENV{ID_PART_TABLE_TYPE}!="", ENV{DEVTYPE}=="partition", RUN+="/usr/bin/sudo -u guest DISPLAY=:0 /usr/bin/Usb-Poweroff.sh"