Notices


Reply
Thread Tools
Posts: 436 | Thanked: 406 times | Joined on Jan 2010
#361
Originally Posted by michaelxy View Post
Thanks for your advice.

I tried different variants of the command: "cd /home/user/MyDocs/Scripts && sh HelloWorld.sh" (the rights on the script and directory are 777 etc) But it only writes: "Invalid Command". May be the DCEW can not handle this kind of output ?
The script runs, but I guess your script would need the xterm window to open...I guess thats why i didn't show up. I tested mine on a script (helloworld.sh) which simply had the command:

echo hello world

This replaced the "invalid command" text with "hello world", which prove that my script ran...

Maybe try changing this line in your script:

print s[randint(NR)]

to

echo s[randint(NR)]

Edit: I might try playing around with your script later to get it to show texts on the widget...I can't make any promises though.

Last edited by SavageD; 2010-09-17 at 17:44.
 
Posts: 3 | Thanked: 0 times | Joined on Oct 2010
#362
Hi

The script runs, but I guess your script would need the xterm window to open...I guess thats why i didn't show up. I tested mine on a script (helloworld.sh) which simply had the command:

echo hello world

This replaced the "invalid command" text with "hello world", which prove that my script ran...

Maybe try changing this line in your script:

print s[randint(NR)]

to

echo s[randint(NR)]

Edit: I might try playing around with your script later to get it to show texts on the widget...I can't make any promises though.



managed network services
 
Posts: 71 | Thanked: 4 times | Joined on Mar 2010
#363
hi,

I wanted to run 2 desktop commands if possible.. but I can't figure out how to input the code or if its even possible..

the first is for a customised kernel:

sudo gainroot
/home/user # /usr/sbin/kernel-load /home/user/MyDocs/kernel.txt

the second was for a command line app live-f1 which logs you into and gives you the stats at http://www.formula1.com/live_timing/
the command for which is just:

live-f1
 
Posts: 89 | Thanked: 52 times | Joined on Jan 2010 @ London, UK
#364
I wanted to run 2 desktop commands if possible.. but I can't figure out how to input the code or if its even possible..
Did you mean two separate DCEW buttons/boxes? Just add another widget once you've added the first one, DCEW will still be in the list to add. In the dialog that comes up to edit the settings for the 2nd one, set the sizes and when you want it to run and then choose the command to run in it or "Add Cmd" to set your own new one up to then choose from in your list of commands.

If instead you mean run two commands in the same widget with one press/whatever action you set it for running both commands, read on...


There are several ways to join commands together. You can create one script file saved somewhere containing all the commands, one per line, each of which could be a call to another script (as in some previous examples on earlier pages). It will run each command and wait for it to finish before doing the next unless you join commands together using any of the command-list joiners below.

Or in the DCEW command field, chain the commands together with command-list functions:
* semicolon (';') - just runs the next command once the current one finishes, ignores result of command.
* 2 ampersands ('&&') - if you want the next command to only run when the current one finishes ok, or
* 2 vertical-bars (aka "pipe" in unix terminology, "||" - not L's or 1's or upper-case i's) - when you want the next command to run only when the current one fails. Also see some previous examples on earlier pages.

You can combine && and ||, to do one thing if the first command succeeds and another if it fails (as long as the thing to do if the first one succeeds always works ok otherwise it'll do nothing when the first one fails). Examples exist earlier in the thread again, but for another:

cat info.txt 2>/dev/null && echo INFO OK || echo ERROR

Which will output the contents of info.txt and then "INFO OK". If info.txt doesn't exist, the "cat" command will fail and output an error (which, using the 2>/dev/null, we send into a black hole so you never see it). This command failing will mean that the "echo ERROR" runs instead of the "echo INFO OK" so you'll get a single bit of text output saying "ERROR".

See the 'bash' (or ksh or sh) linux manual page or other useful explanation on the web :-) (google it or if you run Linux anywhere open a terminal and type "man bash" and press enter. Look for the section about "command lists".

If one of the commands will be a long-running process and you want the other command(s) to start before the earlier ones finish (at the same time as the earlier one(s) start), you can put a single '&' after the command (and won't need and indeed can't use semicolon or && or ||) . It will then immediately carry on with the rest of the commands once its started it.

I believe they'll all work as I expect in DCEW. If it doesn't work there, put it in a script file and run that as the command as shown in earlier posts. And test it first before running in DCEW (from the terminal) - remember,
if it runs for too long a time it will hang up your phone and could end up you needing to reflash it (though usually when I turn mine off and on again after problems with editing/adding widgets it loses the DCEW widgets and some/all others, so it works again).
Btw, separate the && or whatever with a space from the command and anything after it (except ';', you can put that right at the end of the command).

Oh, and just to output text into the widget from a file, I use the 'cat' command. I have a large DCEW on one of my home screens that displays some text from a file depending on time of day, so when Im likely to be commuting home it shows which platform to go to at one of my stations depending on the time (as there's a bit of a trek to the other one for every other train), and at other times it shows more relevant info.

The way I did that was have a directory in my machine and files named by the hour and make the filename in the command depend on the time using $(date +%H) to generate the current hour as part of the filename, outputting a default file if the specified one doesn't exist (using '||' between commands).

Last edited by jgbreezer; 2010-11-18 at 11:43.
 

The Following User Says Thank You to jgbreezer For This Useful Post:
Posts: 188 | Thanked: 53 times | Joined on May 2010
#365
just wanted to say thanx for this great app! still haven't made the jump to qbw, cos DCEW services all my needs!1

lol that sounded naughty, haha
 
Posts: 8 | Thanked: 1 time | Joined on Feb 2011
#366
dears, sorry to spent your time with stupid question... how to create a script in dcew to copy some file?
I have tried to create this: cp /path1/file /path2/file but if I click on it on desktop nothing happen
thank you very much
m.
 
moudy91's Avatar
Posts: 165 | Thanked: 18 times | Joined on Jun 2010
#367
i usual i use the cat command so i can see my notes but i need a script that i will access it from my desktop, and the location of my note is /home/user/MyDocs/note.html
how can i do that ?
i have this script but i can't open my text location:

dbus-send --type=method_call --dest=com.nokia.HildonDesktop.AppMgr /com/nokia/HildonDesktop/AppMgr com.nokia.HildonDesktop.AppMgr.LaunchApplication string:"osso_notes"

please can anyone correct it, thank you
 
Posts: 56 | Thanked: 21 times | Joined on Feb 2011 @ Bangalore, India
#368
Guys, urgent help needed. I installed a widget (lock screen and keys) in my home screen and forgot to disable "Update when switched to desktop"...so I am unable to unlock my phone now. Please help.
 
Posts: 56 | Thanked: 21 times | Joined on Feb 2011 @ Bangalore, India
#369
Somehow managed to move to a different homescreen where the widget is not istalled....and uninstalled....Guys be very careful with the button widgets....
 
Posts: 24 | Thanked: 33 times | Joined on Dec 2009
#370
Hey guys! Does anybody know how to adjust the transparency of these widgets? I'd really appreciate the help.
 
Reply


 
Forum Jump


All times are GMT. The time now is 16:00.