1) Create a local udev script file:
/etc/udev/rules.d/z21_local.rules
ACTION=="add",KERNEL=="ttyACM0",SUBSYSTEM=="tty",ATTRS{product}=="Sony Ericsson W760",ATTRS{serial}=="3570670210310730",RUN+="/home/shamrock/bin/phonelaunch",SYMLINK+="w760i"
ACTION=="remove",KERNEL=="ttyACM0",SUBSYSTEM=="tty",RUN+="/home/shamrock/bin/phonekill"
2) Script to lauch Wammu
#!/bin/bash
export HOME = /home/shamrock
set -x
xhost local:shamrock
export DISPLAY=:0.0
cd /home/shamrock
su shamrock -c "/usr/bin/wammu &"
3) Script to clean up on removal
#!/bin/bash
su shamrock -c "pkill wammu"
The details for the udev rules came from running:
sudo udevadm info --name=/dev/ttyACM0 --query=all --attribute-walk
Enjoy!
No comments:
Post a Comment