Notices


Reply
Thread Tools
moudy91's Avatar
Posts: 165 | Thanked: 18 times | Joined on Jun 2010
#1331
Originally Posted by magic_doc View Post
try

Code:
osso-xterm -e /path/to/yourscript
should open an xterm with your scipt running in it.

HTH & HAND

Michael
Hi,
Nothing happens even the xterm did not open at all.
 
Posts: 87 | Thanked: 80 times | Joined on Sep 2009
#1332
try your command from the commandline (xterm launched from desktop) first- if this works then try it from the widget cmd-field.

CU Michael
 
moudy91's Avatar
Posts: 165 | Thanked: 18 times | Joined on Jun 2010
#1333
Originally Posted by magic_doc View Post
try your command from the commandline (xterm launched from desktop) first- if this works then try it from the widget cmd-field.

CU Michael
Hi
In xterm its working just fine but in the qbw nothing happens, must be something missing in the script
 
Posts: 2,290 | Thanked: 4,134 times | Joined on Apr 2010 @ UK
#1334
Don't you need to chmod the script?
__________________

Wiki Admin
sixwheeledbeast's wiki
Testing Squad Subscriber
- mcallerx - tenminutecore - FlopSwap - Qnotted - zzztop - Bander - Fight2048 -


Before posting or starting a thread please try this.

Last edited by sixwheeledbeast; 2012-03-03 at 21:42.
 
moudy91's Avatar
Posts: 165 | Thanked: 18 times | Joined on Jun 2010
#1335
Originally Posted by sixwheeledbeast View Post
Don't you need to chmod the script?
All i need my sh work

o s s o - x t e r m ' r o o t ' ' e c h o " i f c o n f i g w l a n 0 u p " ' ' e c h o " i w l i s t w l a n 0 s c a n " ' ' e c h o " i f c o n f i g w l a n 0 d o w n ' "
 
moudy91's Avatar
Posts: 165 | Thanked: 18 times | Joined on Jun 2010
#1336
Originally Posted by sixwheeledbeast View Post
Don't you need to chmod the script?
hi,
what do you mean about chmod ??? first time i use in my n900
because usual just i use sh /location/ ?.sh then it works , but dont know why this time its only works in xterm but dont work in qbw
 
moudy91's Avatar
Posts: 165 | Thanked: 18 times | Joined on Jun 2010
#1337
i tried this
Code:
osso-xterm -e sh  /path/to/yourscript
just the xterm opens but the script don't opens
PS: in xterm the sh works perfectly
 
Posts: 2,290 | Thanked: 4,134 times | Joined on Apr 2010 @ UK
#1338
I thought it may not run because it wasn't set executable.

I had a go at recreating your problem, seems like QBW forces the script to close. The script as you say works great on it's own.

As a work around you could dump a huge pause in the script.
I can't seem to get it to leave xterm open when executed.

Or you could try and see if you can make a .desktop execute it correctly.

At the moment I have this 30 second pause, a prompt, a 10 second pause.
When running in QBW the "Press Enter" prompt gets skipped.

QBW Command
Code:
osso-xterm -e "sh /home/user/MyDocs/myscript/iwlistscan.sh" | echo ""
iwlistscan.sh
Code:
#!/bin/sh

if [ `id -u` != 0 ] ; then
exec sudo gainroot <<EOF
exec sh $0 $*
EOF
exit $?
fi

ifconfig wlan0 up
iwlist wlan0 scan
ifconfig wlan0 down

sleep 30
read -p "Press Enter Key..." nothing
echo
sleep 10
exit 0;
__________________

Wiki Admin
sixwheeledbeast's wiki
Testing Squad Subscriber
- mcallerx - tenminutecore - FlopSwap - Qnotted - zzztop - Bander - Fight2048 -


Before posting or starting a thread please try this.
 

The Following User Says Thank You to sixwheeledbeast For This Useful Post:
moudy91's Avatar
Posts: 165 | Thanked: 18 times | Joined on Jun 2010
#1339
Originally Posted by sixwheeledbeast View Post
I thought it may not run because it wasn't set executable.

I had a go at recreating your problem, seems like QBW forces the script to close. The script as you say works great on it's own.

As a work around you could dump a huge pause in the script.
I can't seem to get it to leave xterm open when executed.

Or you could try and see if you can make a .desktop execute it correctly.

At the moment I have this 30 second pause, a prompt, a 10 second pause.
When running in QBW the "Press Enter" prompt gets skipped.

QBW Command
Code:
osso-xterm -e "sh /home/user/MyDocs/myscript/iwlistscan.sh" | echo ""
iwlistscan.sh
Code:
#!/bin/sh

if [ `id -u` != 0 ] ; then
exec sudo gainroot <<EOF
exec sh $0 $*
EOF
exit $?
fi

ifconfig wlan0 up
iwlist wlan0 scan
ifconfig wlan0 down

sleep 30
read -p "Press Enter Key..." nothing
echo
sleep 10
exit 0;


Ohhh yes thanks , it worked finally, really thank you.

i have a question can the iwlist scan give me just the SSID and mac ?? because the other info that iwlist scan give me not important for me , all i care about is SSID and mac
 
Posts: 2,290 | Thanked: 4,134 times | Joined on Apr 2010 @ UK
#1340
Why not just use
QBW Command
Code:
echo "iwconfig wlan0" | sudo gainroot | grep ESSID |sed "s/.*ESSID:\"//;s/\".*//" ; echo "iwconfig wlan0" | sudo gainroot | grep Point | sed "s/.*Point: //;s/ //g"
This will display SSID and MAC in a widget.
You will not need the script or xterm then.

If you want to display anything else from iwlist just add another grep command.
__________________

Wiki Admin
sixwheeledbeast's wiki
Testing Squad Subscriber
- mcallerx - tenminutecore - FlopSwap - Qnotted - zzztop - Bander - Fight2048 -


Before posting or starting a thread please try this.
 

The Following User Says Thank You to sixwheeledbeast For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 01:17.