Not able to open the gnome-terminal through bash script on hot plug event.
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:
Code:
# Cypress USB vendor ID = 0x0d85 Code:
#!/bin/bash Code:
#!/bin/bash 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 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 |
Quote:
If your system supports sudo, then try something like this: Code:
$ sudo -i I would suggest that you plan an alternative to launching a terminal. |
Quote:
Dear sir, Quote:
rohan |
Quote:
If you are seeking user input, then you may need to rely on something other than gnome-terminal. P.S. It would be helpful to know what is it that you want to do, not how you want to do it. |
Dear sir,
i have one usb device containing Cypress usb controller. i have developed one user space driver which does 4-5 fucntionalities like firmware download, getdescriptor(shows device descriptors), check_bus_speed, show_IDvendor, this code i have developed using libusb and cyusb parent drivers (usb wrapper). now i want ma device to have hot plug facility, that means whenever device is plugged in one terminal shud get opened and on that my developed code get executed automatically. and gives me options like press 1 for firware download 2. for this n 3. for this like interactive thing. so i used .rule file (udev rules) for getting know that device is connect... and what i am doing i have given in previous posts. i am able to run code through script n get sum functionality on hot plug but i have to have interactive session where it ask me for options what i want to do n here i am dnt knw wats going wrng terminal doesnt open. so need one more option to make it happen or open the terminal kindly consider ma request for help n do rply thanks & Regards rohan |
You might be able to get away with using 'gksu' to launch a terminal. However if you invoke 'gksu' as root, then the terminal will also be launched with root privileges (and this would be a bad idea). To prevent this, you can use the -u option to specify the user who currently is owner of the system display.
In it's basic form, gksu can be used as follows: Code:
gksu gnome-terminal Code:
gksu -u <user> gnome-terminal |
Dear sir,
i tried that also but found no Luck!!! :( Quote:
but terminal is still not opening on the hot plug event. my other code runs on hot plug. but code containg gnome-terminal doesnt work atall how to get rid of this :banghead: thanks for your support sir, please let me know about any solution Regards rohan |
All times are GMT -5. The time now is 10:24 PM. |