OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio

IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Startup Script On Sharp 3.10 Rom, what's the easiest way?
gregarican
post Sep 30 2005, 08:38 AM
Post #1





Group: Members
Posts: 24
Joined: 4-August 05
Member No.: 7,783



I have an SL-5500 running Sharp ROM 3.10 and am looking for a way to run a script as root when the PDA finshes loading Qtopia. Here's the basic idea of the script:

#!/bin/sh

/usr/sbin/smbd -D
/usr/sbin/nmbd -D
/usr/bin/smbmount //server_box/share1 /mnt/share1 -o username=user%pass
/usr/bin/smbmount //server_box/share2 /mnt/share2 -o username=user%pass

I tried symlinking /etc/rc.d/rc.local to /etc/rc.d/rc5.d/S49local but this didn't get the job done. Since the Zaurus runs as the zaurus user and not the root use I am having problems running the script unless I connect in and su as the root user.

Figuring sudo would be a thing to try I installed the ipk for it but before I could even verify and configure the /etc/sudoers file the root user account got messed up.

So here I am back at a restore point where I am trying to get this script to launch as Qtopia is loaded up. What's the easiest way to do this?
Go to the top of the page
 
+Quote Post
gregarican
post Sep 30 2005, 11:27 AM
Post #2





Group: Members
Posts: 24
Joined: 4-August 05
Member No.: 7,783



Here are two other questions related to my SL-5500 that I was wondering about:

1) Is there a way to launch HancomMobileWord from the command line with a filename as the argument? Something like

CODE
HancomMobileWord /home/zaurus/myDocument.doc


2) I would like to view TIF/TIFF files on the Zaurus. When I attempt to do so with the ImagePad application that comes with the Sharp ROM 3.10 I receive an error message stating 'The file wasn't opened.' Is there a recommended image viewer that I can use to view TIF/TIFF files?

Any pointers would be greatly appreciated.

Thanks!
Go to the top of the page
 
+Quote Post
lardman
post Oct 1 2005, 02:16 AM
Post #3





Group: Members
Posts: 4,515
Joined: 25-October 03
From: Bath, UK
Member No.: 464



QUOTE
looking for a way to run a script as root when the PDA finshes loading Qtopia


iirc the init scripts stop when Qtopia is loaded so you can't use them.

Can you not do this before Qtopia is loaded? In which case add it to the init scripts, otherwise I'd add it to /etc/init.d/qpe (I think that's the name of the script which is used to start Qtopia - I'm not running it so this is from memory).

QUOTE
Is there a way to launch HancomMobileWord from the command line with a filename as the argument?


I imagine it requires a QCOP call to tell it which file to open.

No idea about the TIFFs I'm afraid.


Si
Go to the top of the page
 
+Quote Post
gregarican
post Oct 1 2005, 06:29 AM
Post #4





Group: Members
Posts: 24
Joined: 4-August 05
Member No.: 7,783



QUOTE(lardman @ Oct 1 2005, 06:16 AM)
QUOTE
looking for a way to run a script as root when the PDA finshes loading Qtopia


iirc the init scripts stop when Qtopia is loaded so you can't use them.

Can you not do this before Qtopia is loaded? In which case add it to the init scripts, otherwise I'd add it to /etc/init.d/qpe (I think that's the name of the script which is used to start Qtopia - I'm not running it so this is from memory).

QUOTE
Is there a way to launch HancomMobileWord from the command line with a filename as the argument?


I imagine it requires a QCOP call to tell it which file to open.

No idea about the TIFFs I'm afraid.


Si
*


Thanks for the reply. I will check regarding the /etc/init.d/qpe file to see if I can start Samba and mount my network Samba shares that way. I did a ps -ax and saw that the HancomMobileWord process was followed by a qcop argument. What is the syntax if I wanted to launch a specific document? Something like /tmp/thisDocument.doc? Would I issue a command line of
CODE
HancomMobileWord -qcop /tmp/thisDocument.doc

If you could provide me an example I'd be eternally grateful. Sorry for my ignorance. I used the Z back in 2002-2003 and just picked it up again for some Ruby/Qt projects I've been working on. Very rusty to say the least :-)
Go to the top of the page
 
+Quote Post
lardman
post Oct 1 2005, 07:59 AM
Post #5





Group: Members
Posts: 4,515
Joined: 25-October 03
From: Bath, UK
Member No.: 464



I think you'd start Hancom Word, then issue the QCop call separately (though it's only a guess).

Here's a list of some commands: http://doc.trolltech.com/qtopia2.1/html/qcop.html

Though from my understanding each app can have it's own calls (there was an app floating round a while back which listed all of the calls being made - Japanese iirc, anyone remember what it was?)

In any case you may be okay with a plain "setDocument()" call.


Si
Go to the top of the page
 
+Quote Post
gregarican
post Oct 1 2005, 02:05 PM
Post #6





Group: Members
Posts: 24
Joined: 4-August 05
Member No.: 7,783



QUOTE(lardman @ Oct 1 2005, 11:59 AM)
I think you'd start Hancom Word, then issue the QCop call separately (though it's only a guess).

Here's a list of some commands: http://doc.trolltech.com/qtopia2.1/html/qcop.html

Though from my understanding each app can have it's own calls (there was an app floating round a while back which listed all of the calls being made - Japanese iirc, anyone remember what it was?)

In any case you may be okay with a plain "setDocument()" call.


Si
*

So it looks as if I would issue something like
CODE
qcop QPE/Application/HancomMobileWord 'setDocument(QString)' 'thisDocument.doc'

in order to have HancomMobileWord launch the document I want. Since my Z is back at the office I will have to wait until Monday to play around with qcop some. Hopefully it won't take too much fiddling. That will leave me with the tiff image viewing as the only thing I need in order to have my Ruby/Qt app fully ported over from its native win32 platform. Since I installed the libtiff ipk the other day maybe looking at it closer will close that gap as well.

I can say that after experimenting with a couple of the GUI toolkits (Tk, Qt, and GTK) so far I find Qt the best fit for my needs. It's relatively object-oriented and seems to be portable enough for my needs. The fact I prefer using Ruby and am limiting my PDA choice to the Z makes this all the much better I guess...
Go to the top of the page
 
+Quote Post
gregarican
post Oct 1 2005, 06:09 PM
Post #7





Group: Members
Posts: 24
Joined: 4-August 05
Member No.: 7,783



QUOTE(lardman @ Oct 1 2005, 11:59 AM)
Though from my understanding each app can have it's own calls (there was an app floating round a while back which listed all of the calls being made - Japanese iirc, anyone remember what it was?)
*

Actually I found the app that you are talking about. It's here.. http://www2.gol.com/users/ikezawa/zaurus/qcoptest.html
. I am going to give it a go Monday to see what methods I can pass along to HancomMobileWord. As much as I like to Microsoft bash, at least my Ruby/Qt app on win32 can launch the documents by just passing the document name as the first command line argument. Like
CODE
c:\program files\microsoft office\office\winword.exe myDocument.doc

Appreciate the help though. This should get me going.
Go to the top of the page
 
+Quote Post
gregarican
post Oct 3 2005, 04:50 AM
Post #8





Group: Members
Posts: 24
Joined: 4-August 05
Member No.: 7,783



As a follow-up on this, now it's first thing Monday morning here and I tried the qcop QPE/Application/HancomMobileWord 'setDocument(QString)' '/tmp/thisDocument.doc' command. Worked like a champ. Thanks for the help!
Go to the top of the page
 
+Quote Post
lardman
post Oct 3 2005, 06:00 AM
Post #9





Group: Members
Posts: 4,515
Joined: 25-October 03
From: Bath, UK
Member No.: 464



No problem, glad it worked,


Si
Go to the top of the page
 
+Quote Post
gregarican
post Oct 3 2005, 06:13 AM
Post #10





Group: Members
Posts: 24
Joined: 4-August 05
Member No.: 7,783



QUOTE(lardman @ Oct 3 2005, 10:00 AM)
No problem, glad it worked,


Si
*

And as a follow up for anyone who's interested there is a tiff viewer available for the Zaurus. It's part of zfax (http://www.iaccarino.de/silvio/zfax.htm). After installing that and having a nicely sized swapfile I should be over than hurdle as well...
Go to the top of the page
 
+Quote Post
gregarican
post Oct 3 2005, 08:03 AM
Post #11





Group: Members
Posts: 24
Joined: 4-August 05
Member No.: 7,783



The tiff angle still isn't too feasibile. Even with a large swapfile on my SD card I can't open the images. They are too large it seems. But I know with smaller images the tiff viewer app works.

A new problem arose using the qcop method. When I bring up the Hancom Word app with the document I want and then close Hancom Word, my Ruby/Qtopia application disappears from the screen. I do see the active process listed running the ps command, however. Is there an easy way to make it visible again? I am passing along the Ruby system() method to bring up Hancom Word. Something like:
CODE
system("qcop QPE/Application/HancomMobileWord 'setDocument(QString)' '/path/to/myDocument.doc'")

This system() methods forks out a subshell and should return back to the main Ruby/Qtopia application. Although the Ruby script is still an active process the Qtopia app has disappeared. How can I bring it back?
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 19th December 2014 - 07:12 AM