Differences between version 2 and previous revision of UdevSounds.
Other diffs: Previous Major Revision, Previous Author
Newer page: | version 2 | Last edited on Tuesday, 21 August 2007 2:11:49 | by CyberLeo | Revert |
Older page: | version 1 | Last edited on Tuesday, 21 August 2007 2:05:59 | by CyberLeo | Revert |
@@ -1,10 +1,10 @@
/etc/udev.rules/00-bling.rules:
<verbatim>
-RUN+="/tmp
/sounds/hw.sh"
+RUN+="/etc/udev
/sounds/hw.sh"
</verbatim>
-/tmp
/sounds/hw.sh:
+/etc/udev
/sounds/hw.sh:
<verbatim>
#!/bin/bash
#logger -t "hw.sh" "$(whoami) Honoring ${ACTION} for ${SUBSYSTEM}..."
@@ -15,14 +15,18 @@
fi
if [ "${ACTION}" = "add" ]
then
- /usr/bin/aplay /tmp
/sounds/hw_insert.wav &
+ /usr/bin/aplay /etc/udev
/sounds/hw_insert.wav &
exit 0
elif [ "${ACTION}" = "remove" ]
then
- /usr/bin/aplay /tmp
/sounds/hw_remove.wav &
+ /usr/bin/aplay /etc/udev
/sounds/hw_remove.wav &
exit 0
fi
</verbatim>
+
+Note that aplay likely won't work if you have a sound manager like esd squatting on the sound devices, so set it to give them up after a while.
+
+Also, sound managers like esd won't work because they disallow connections from sources that don't match credentials
Salt and pepper to taste...
version 2
/etc/udev.rules/00-bling.rules:
RUN+="/etc/udev/sounds/hw.sh"
/etc/udev/sounds/hw.sh:
#!/bin/bash #logger -t "hw.sh" "$(whoami) Honoring ${ACTION} for ${SUBSYSTEM}..." if [ "${SUBSYSTEM}" != "usb" ] then exit 0 fi if [ "${ACTION}" = "add" ] then /usr/bin/aplay /etc/udev/sounds/hw_insert.wav & exit 0 elif [ "${ACTION}" = "remove" ] then /usr/bin/aplay /etc/udev/sounds/hw_remove.wav & exit 0 fi
Note that aplay likely won't work if you have a sound manager like esd squatting on the sound devices, so set it to give them up after a while.
Also, sound managers like esd won't work because they disallow connections from sources that don't match credentials
Salt and pepper to taste...