Start script when connecting phone through usb

Posted by choel on Ask Ubuntu See other posts from Ask Ubuntu or by choel
Published on 2012-04-12T08:43:23Z Indexed on 2012/04/14 11:45 UTC
Read the original article Hit count: 221

Filed under:
|

Trying to run a script when my phone is plugged in via USB, a made a udev rule looks like this in /etc/udev/rules.d/85-lazydroid.rule

ATTRS{idVendor}=="22b8", ATTRS{idProduct}=="428c", RUN+="/home/joel/.lazydroid"

And the script .lazydroid looks like this:

#!/bin/bash
exec adb forward tcp:8080 tcp:8080 &
exec chromium-browser 127.0.0.1:8080 --new-window &

The script itself runs fine. The trick is I can't get the script to run up on insertion of the phone.

And it's the right ID according to: lsusb | grep Motorola

Bus 002 Device 042: ID 22b8:428c Motorola PCS

Any ideas?

© Ask Ubuntu or respective owner

Related posts about usb

Related posts about udev