When I plug in a usb stick the device notifier let me select what to do. I would like to change this behavior and want to start Dolphin automatically when a usb drive is attached.
Is there a way to do this?
Is there a way to do this?
#USB-Stick BUS=="usb", KERNEL=="sd?1", SYSFS{idVendor}=="090c", SYMLINK+="CORSAIR", RUN+="/usr/bin/dolphin /media/CORSAIR"
sudo blkid
sudo mkdir -p /media/usb1
sudo chmod 777 /media/usb1
# a mountpoint for the usb flash drive /dev/sde1 /media/usb1 auto noauto,user,rw 0 0
lsusb
#!/bin/sh while [ 1 ] do if [ ! "`lsusb | grep Flash`" ]; then mounted=0 fi if [ "`lsusb | grep Flash`" -a "$mounted" = 0 ]; then mount /media/usb1 dolphin /media/usb1 mounted=1 fi sleep 2 done
/dev/sdb1 does not exist
/dev/sdb1: LABEL="MYLINUXLIVE" UUID="7067-E8B4" TYPE="vfat"
#!/bin/sh while [ 1 ] do if [ ! "`lsusb | grep Flash`" ]; then mounted=0 fi if [ "`lsusb | grep Flash`" -a "$mounted" = 0 ]; then mount /media/usb1 if [ $? -ne 0 ]; then mounted=0 else dolphin /media/usb1 mounted=1 fi fi sleep 2 done
Comment