http://wikisend.com/download/342974/desmontarusbipc11
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Hello im trying to make a little script using yad that notify me when un/plug a usbdrive device in the systray ( just because somethimes forget unplug when leave )
Currently run a udev rule that notify with sound when un/plug, here the example.
/etc/udev/rules.d/90-sonidos_usb.rules
/usr/local/bin/hotplug_usbsoundsDRIVER=="usb", ACTION=="add", RUN+="/usr/local/bin/hotplug_usbsounds +"
SUBSYSTEM=="usb", ACTION=="remove", RUN+="/usr/local/bin/hotplug_usbsounds -"
Code: Select all
#!/bin/sh
DIR="/usr/share/sounds"
CMD="aplay"
case "$1" in
+)
$CMD $DIR/insert.wav &
;;
-)
$CMD $DIR/remove.wav &
;;
esac
Code: Select all
udevadm control --reload
Code: Select all
#!/bin/sh -x
ICON=/usr/local/lib/X11/pixmaps/usbdrv48.png
TOOLTIP="Botón Izquierdo: Actualizar | Botón Derecho: Menú"
mkfifo /tmp/01
exec 3<> /tmp/01
function func_menu() {
exec 3<> /tmp/01
# Obtener lista de unidades de almacenamiento montadas
LISTSDX=($(df | grep /sd | cut -f1 -d ' '))
for DRIVE in ${LISTSDX[@]}; do
# Comprobar si los dispositivo de la lista son USB. True: Crear menu. False: Remover de la lista
udevadm info -q path -n $DRIVE | grep usb && MENUCMD+="