You are not logged in.

#1 2012-07-27 09:54:30

sistematico
Member
From: Campo Grande / MS / Brasil
Registered: 2008-07-26
Posts: 97
Website

[ALMOST-SOLVED] Execute action on USB insert

Hello everyone!
I have a udev rule like this:

ACTION=="add", RUN+="/bin/sh -c 'DISPLAY=:0 /usr/bin/notify-send In'"
ACTION=="remove", RUN+="/bin/sh -c 'DISPLAY=:0 /usr/bin/notify-send Out'"
[lucas@ironhide ~]:% ls -l /etc/udev/rules.d/99-local.rules                 [0]
-rwxr-xr-x 1 root root 144 Jul 26 02:31 /etc/udev/rules.d/99-local.rules

But not working!
Anyone can help?

Last edited by sistematico (2012-07-31 11:52:16)


Lucas Saliés Brum
blog | medium | vk | twitter | github | .share
Forgive the spelling and grammar, English is not my native language.

Offline

#2 2012-07-27 10:27:31

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [ALMOST-SOLVED] Execute action on USB insert

You need to specify the usb subsystem in the rule - there are various examples on the udev wiki page.

Offline

#3 2012-07-27 11:32:42

uzsolt
Member
Registered: 2012-06-13
Posts: 56

Re: [ALMOST-SOLVED] Execute action on USB insert

Maybe you can use a "framework", udisks-glue-git or similar so you don't need edit systemwide files.

Offline

#4 2012-07-28 04:07:41

sistematico
Member
From: Campo Grande / MS / Brasil
Registered: 2008-07-26
Posts: 97
Website

Re: [ALMOST-SOLVED] Execute action on USB insert

Thank you all!
----------------------- EDIT -----------------------
Solved with udisks-glue (thanks uzsolt) + sysnotify (thanks grawity@freenode), and thank you tomk to point new direction.

https://gist.github.com/3196257
https://gist.github.com/1338329

Last edited by sistematico (2012-07-29 05:39:50)


Lucas Saliés Brum
blog | medium | vk | twitter | github | .share
Forgive the spelling and grammar, English is not my native language.

Offline

#5 2012-07-31 11:51:48

sistematico
Member
From: Campo Grande / MS / Brasil
Registered: 2008-07-26
Posts: 97
Website

Re: [ALMOST-SOLVED] Execute action on USB insert

Stop working since i switch to Systemd.
Any help are welcome.


Lucas Saliés Brum
blog | medium | vk | twitter | github | .share
Forgive the spelling and grammar, English is not my native language.

Offline

Board footer

Powered by FluxBB