Tiny Core Linux

Tiny Core Base => TCB Talk => Topic started by: dentonlt on November 10, 2010, 10:57:15 PM

Title: Ondemand: append "$1" to command line?
Post by: dentonlt on November 10, 2010, 10:57:15 PM
I'm using stock 3.2. Redirect me if this has already been mentioned - I couldn't find it in the forum.

If I call an 'ondemand' item from a running program, then the stock ondemand script does not pass arguments on first call. For example:


On the first time, that opens a blank leafpad window (expected). Later attempts pass arguments. Explanation:

On first call, pcmanfm calls something like:

Code: [Select]
/mnt/hda2/tce/ondemand/leafpad [filename]
But the ondemand script does not pass along any arguments:

Code: [Select]
[ $(which leafpad) ] && exec leafpad
Since pcmanfm has sent a filename as argument ... I've edited my ondemand script to read:

Code: [Select]
[ $(which leafpad) ] && exec leafpad "$1"
That pops open the file on first load. I make the same edit to other ondemand scripts: firefox, openoffice, geeqie, evince, etc. Notably document readers which being called from a file manager, or being called from the CLI with an argument.

I'm not sure if this is a 'desired option' or a 'necessary function.' Not all ondemand extensions will receive an argument on first call (if ever). Perhaps it is possible to check the extension's desktop/application file to see what type of application it is, and then append "$1" to the ondemand script if an argument is likely?

?
Title: Re: Ondemand: append "$1" to command line?
Post by: roberts on November 11, 2010, 01:24:59 AM
Already done. See: Change log for v3.3rc1 http://forum.tinycorelinux.net/index.php?topic=7671.0
* Updated ondemand generated scripts to pass command line arguments.
Title: Re: Ondemand: append "$1" to command line?
Post by: dentonlt on November 11, 2010, 01:28:34 AM
Oops - I should get the current RC!  ::)