Dear everyone,
sir i am able to catch the hot plug event of USB device through udev .rule. Even i am able to run ma bigger code with the help of bash scripting only on the event.
but as i am interested in executing the my interactive code on new terminal. so i tried so much to open terminal with "gnome-terminal" command through script.
but its not working fine with udev .rule file, its not opening the terminal on hot plug event. if i ran the script indpendently like ./d.sh to open terminal through this script, everythng goes fine.
seriously need the help Now plzZZZ
for more understanding,
mY
udev rules is which call a script run.sh
Quote:
on hot plug run_code.sh is executed
|
Code:
# Cypress USB vendor ID = 0x0d85
KERNEL=="*", SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="add", ATTR{idVendor}=="0d85", MODE="666", TAG="cyusb_dev", RUN+="/usr/bin/run_code.sh A"
KERNEL=="*", SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="remove", TAG=="cyusb_dev", RUN+="/usr/bin/run_code.sh R"
run_code.sh is
Code:
#!/bin/bash
nohup /home/ivb/"d.sh" &
exec /bin/bash
~
d.sh is script which calls gnome-terminal like
Code:
#!/bin/bash
sleep 1
/usr/bin/gnome-terminal
exec /bin/bash
1.why this gnome-terminal is not opening??
2.if i run any of sample code (with no call to gnome-terminal) it works fine with event of pluging.
3. if i run d.sh independentaly like
Code:
ivb@ivb-desktop:~$ ./d.sh
terminal gets open
4.but with link to udev .rule the d.sh script doent work fine the gnome-terminal never gets open
please kindly consider ma request n give solution and way to it.
Thanks & Regards
Rohan