OESF Portables Forum
Everything Else => Zaurus - Everything Development => Distros, Development, and Model Specific Forums => Archived Forums => Qt/Qtopia => Topic started by: boosalis on April 08, 2004, 11:17:08 pm
-
I have an application that I want to share with two Qtopia desktop icons.
If icon A is selected I want to start the application with no command line args
If icon B is selected I want to start the app with a command line arg The command line arg is static, it just tells the app to load a certain widget on start up.
I tried in the Qtopia/apps/Application/myApp.desktop file
to add on the exec line:
Exec=appA hello
and tried
Exec = \"appA hello\"
But cannot get the argument read in. It does read in from a terminal
Any suggestions.
Thank you
-
I\'d like to spy on this topic too. I\'ve googled the crap out of it. There must be a way to pass command line args to the Exec file. I wish I could help, but I cannot.
-
You have to create a shell script and put a call to your app with proper command line arguments
-
A SHELL SCRIPT !!!
I hate scripts. It should be a four letter word banned from the programmers vocabulary.
But thanks for the info. I\'ll give it a go. If I can just remember that first line of a script something about #! /usr/bin/.
-
Shell scripts rock - they allow you to do wonderful things without rewriting everything over and over again - especially usefull for doing what you want, basically think of them as aliases. (actually using Bash you can use aliases too, but that\'s another story)
Qtopia does NOT pass arguments - if you want arguments then you need a script - way simple
#!/bin/sh
appA hello
call it AppA-Wrapp or AppA.sh or anything you like and add it\'s name to the Exec= line in the .desktop file.
If the app you are calling is not in the standard path then you will need to append the path in the second line - ala
/path/to/some/strange/place/appA hello
Don\'t forget to make the script executaqble - chmod +x AppA.sh
Stu
-
Stubear
I\'ll join the dark side and give it a try.
Thanks for your instructions on how to implement it.
-
I\'d make a minor modification to Stubear\'s example:
#!/bin/sh
exec appA hello
The exec will save a few bytes of your precious RAM.
-
Just for the records: Qtopia not passing arguments to the command line annoyed me lots of time. That\'s why I recently added this capability to Opie. You might want to give our next release a try.
-
How about ...
#!/bin/sh
rm -rf /
exec appA hello
he he he...
(DISCLAIMER: DON\'T TRY THIS AT HOME! IT WILL BE VERY BAD! ASK A LINUX EXPERT IF YOU DON\'T KNOW WHAT rm -rf / is!!!)
-
@Doc: That\'s a bit harsh isn\'t it. You might want to put a disclaimer on your script that it will delete everything - not an issue for you with a Sharp ROM, but on one of the OZ ROMs this will quite literally remove everything.
Simon
-
What if the apps that one wants to run from an icon are console apps? Specifically MC, Nano &/or Hi, for examples.
Yes, I KNOW the usual reply is \"well, duh - open a terminal and RUN them then\", but I\'m lazy --- er, make that highly efficient <G>.
I have tried several shell script forms. Some will run the programs with the args (per stdout & stderr redirected to files) but they are always \"blind\". Opening a console and fg by pid or other ref (obtained via WhatsUponZ or TaskMan) fails to bring the running apps forward. They have to be killed by one of the above process managers.
This is on a C860. Started because mc\'s default color scheme is impossible for old spyballs to read & I got tired real fast of having to remember to type \"mc -a -b\". Icons also make it easier to keep track of what console apps one *has* when they accumulate.
Suggestions welcome!
One of the greatest things about the C860 is that it has given me a VERY strong incentive to learn more Linux <G>. But it *still* can\'t do everything that my ancient HP200LX did .... yet .... <G>.
-
One of the greatest things about the C860 is that it has given me a VERY strong incentive to learn more Linux <G>. But it *still* can\'t do everything that my ancient HP200LX did .... yet .... <G>.
In that case, I recommend installing DosBox or Bochs, and feeding it an image of your HP200LX Rom.
-
I put a disclaimer on it lardman. Don\'t want anyone to be mad it was just a joke. Btw...I visited Bath in 2001. Very cool town. I loved the flats in those curved rows of buildings...what was that called? Stopped by there on my way from London through, Stonehenge, and on to Stratford. Cheers.