The Following User Says Thank You to cpscotti For This Useful Post: | ||
|
2010-08-25
, 13:14
|
Posts: 384 |
Thanked: 95 times |
Joined on Jan 2010
@ Romania
|
#352
|
b)I currently use 4 widgets on my desktop and no lockups so far, suggesting that maybe the commands themselves are the problem.
|
2010-08-25
, 13:17
|
Posts: 112 |
Thanked: 122 times |
Joined on Dec 2009
@ London, United Kingdom
|
#353
|
The Following User Says Thank You to cpscotti For This Useful Post: | ||
|
2010-08-30
, 22:16
|
Posts: 131 |
Thanked: 46 times |
Joined on Oct 2009
@ Michigan
|
#354
|
|
2010-09-12
, 12:41
|
Posts: 171 |
Thanked: 13 times |
Joined on Nov 2009
|
#355
|
|
2010-09-13
, 08:22
|
|
Posts: 165 |
Thanked: 18 times |
Joined on Jun 2010
|
#356
|
|
2010-09-14
, 12:11
|
Posts: 64 |
Thanked: 24 times |
Joined on Aug 2007
@ Germany ...
|
#357
|
|
2010-09-15
, 07:53
|
Posts: 64 |
Thanked: 24 times |
Joined on Aug 2007
@ Germany ...
|
#358
|
#/bin/sh # randomquote - Given a one-line-per-entry datafile, this # script randomly picks one line and displays it. Best used awkscript="randomquote.awk.$$" if [ $# -ne 1 ] ; then echo "Usage: randomquote datafilename" >&2 exit 1 elif [ ! -r "$1" ] ; then echo "Error: quote file $1 is missing or not readable" >&2 exit 1 fi trap "/bin/rm -f $awkscript" 0 cat << "EOF" > $awkscript BEGIN { srand() } { s[NR] = $0 } END { print s[randint(NR)] } function randint(n) { return int (n * rand() ) + 1 } EOF awk -f $awkscript < "$1" exit 0
|
2010-09-15
, 15:05
|
Posts: 436 |
Thanked: 406 times |
Joined on Jan 2010
|
#359
|
I found this shell script which is running well in the shell. But I dont know the working syntax for the Desktop Command Execution Widget.
random.sh:
With "random.sh textfile.txt" it writes one line to the shell.Code:#/bin/sh # randomquote - Given a one-line-per-entry datafile, this # script randomly picks one line and displays it. Best used awkscript="randomquote.awk.$$" if [ $# -ne 1 ] ; then echo "Usage: randomquote datafilename" >&2 exit 1 elif [ ! -r "$1" ] ; then echo "Error: quote file $1 is missing or not readable" >&2 exit 1 fi trap "/bin/rm -f $awkscript" 0 cat << "EOF" > $awkscript BEGIN { srand() } { s[NR] = $0 } END { print s[randint(NR)] } function randint(n) { return int (n * rand() ) + 1 } EOF awk -f $awkscript < "$1" exit 0
But how can I get this working in Desktop Command Execution Widget ?
Thanks
|
2010-09-17
, 06:41
|
Posts: 64 |
Thanked: 24 times |
Joined on Aug 2007
@ Germany ...
|
#360
|
a)The version 1.10 (on extras-devel/extras-testing) is, for sure, safer than 0.9
b)I currently use 4 widgets on my desktop and no lockups so far, suggesting that maybe the commands themselves are the problem.
c) Queen Beecon Widget is quite safer (albeit more bloated) since it executes commands asynchronously and is under current development.
Happy n900 owner!
Check my apps: n900fly, accdisplay and the "desktop command execution" widget!