Comment 9 for bug 500398

Revision history for this message
rcspam (rcspam) wrote :

here is a solution to fix it:

create 2 rules in a /etc/udev/rules.d/90-kidizoom.rules with this:

KERNEL=="sd?1", SUBSYSTEMS=="scsi", ACTION=="add", ATTRS{vendor}=="VTech ", ATTRS{model}=="Kidizoom ", SYMLINK+="kidizoom", RUN+="/path/to/mount-script %k"
KERNEL=="sd?1", SUBSYSTEMS=="scsi", ACTION=="remove", ENV{ID_VENDOR}=="VTech*", RUN+="/path/to/umount-script %k"

Dont forget to reload udev: "sudo service udev restart"

Write the mount-script:

#!/bin/bash

mk() {
 pumount /dev/$1
 sleep 1
 pmount -t vfat /dev/kidizoom KIDIZOOM
 xhost local:$2
 nautilus /media/KIDIZOOM
}

user=`who | grep :0\) | cut -f 1 -d ' '`
export DISPLAY=:0.0
export -f mk
su $user -c "mk $1 $user"

And the umount-script:

#!/bin/bash

umk() {
 pumount /dev/$1
 sleep 1
 xhost local:$2
 zenity --info --text "Kidizoom is unmount"
}

user=`who | grep :0\) | cut -f 1 -d ' '`
export -f umk
export DISPLAY=:0.0
su $user -c "umk $1 $user"

It works for me (maverick)