Using commands with command line arguments Thread last updated on 2006-05-15 05:53:43

Posted by member 321225 on 2006-04-23 17:20:26

Hello,

(I hope I put this in the right forum, if it fits somewhere else better just move it...)

I'm still quite new to litestep, but so far I like it a lot. I'm still using the austerity (default) theme, mainly because I like the appearance a lot. Unfortunately so far I haven't been able to place commands with command line arguments in the quicklaunch (the one right to the VWM, not the real one).

Ok here it goes:
In themevars.rc you can set the SC#?Click (like SC1LClick) variables to whatever programs you want. It just stops working if you use command line arguments like (as a primitive example):
SC1RClick "$CmdPrompt$ /t:78"
I tried pretty much every imaginable variant of quotation like "'$CmdPrompt$' /T:78", $CmdPrompt$" /T:78" and so on. It also doesn't work with the 'plain' version "C:\Windows\cmd.exe /t:78"

So I had a closer look at quicklaunch_icons.rc where the command is actually assigned to the shortcut. If I manualy write the command in the Brackets like ["c:\windows\cmd.exe" /t:78] it works, but only if the quotation ends after the filename (which of course it can't when using the variable).
I can omit the quotes around the variale completely, but then it only works as long as there is no space in the path to the executable.

I even tried filling in and passing !execute ['c:\windows\cmd.exe' /t:78] but apparently those brackets can't be cascaded (once again every way to put quotes in there I tried).

I can could get it to work by writing the commends here directly and I could use a second variable like ["$SC1LClick$" $SC1LClickArgs$] but I'd really like to make it work with just 1 variable. Mostly because I've spend the better part of today trying fo figure it out, and I'd just like to know if it's possible and how.

So thank you for for your help in advance and being patient with me :D

bye
Creat

Posted by member 1 on 2006-04-23 18:23:26 link

I would do something like...

SC1RClick !Execute ["$cmdPrompt$" /t:78]


..that should get you around it. It has to do with the passing of the eVar to the new location and the quotes as you had guessed. Good work!

Posted by member 212670 on 2006-04-23 18:44:55 link

For something like this, you'd probably just want the argument at the source of the variable, which is created in \personal\evars.rc. Then, just $CmdPrompt$ without quotes should work.

Posted by member 99 on 2006-04-26 20:38:17 link

If the first quote is ", it ignores ' and [] and goes until the next ". It will not nest. Same with " and ' swapped, goes until the next ' with no nesting whatsoever. If the first quote is [ you get nesting until the matched ]. I don't remember exactly, but I don't believe it will ignore [] inside " and '.

A variable used in $$ will take the value of the first token on the line after the variable name. If that token has quotes around it, they will be stripped.

x1 "a b" c d
x2 "'a b' c d"

($x1$) = (a b)
($x2$) = ('a b' c d)


For settings, it depends on the module but usually the whole line is used. So if x1 is used as a setting read directly by a module and not used as a variable in .rc, it will be "a b" c d instead.

So if SC1RClick is used as a variable, I'd recommend:
SC1RClick "'$CmdPrompt$' /t:78"


OTOH, if SC1RClick is used directly by a module, you probably want:
SC1RClick "$CmdPrompt$" /t:78


Hopefully I've gotten this right...

Posted by member 99 on 2006-04-26 20:43:20 link

And if it's used as a variable like "$SC1RClick$" (with quotes) then you'll need to change that. Take out the quotes and make sure any file names that need them use "'file name with spaces'" or something.

Posted by member 321225 on 2006-05-15 05:53:43 link

Ok thank you all for your help, I finally got it working.
In the deffinition of SC1RClick I need to quote the command variable (inside quotes can only be ommited if the path contains no spaces), and I removed the quotes from the execution:
SC1RClick "'$CmdPrompt$' /t:78"

and:
[$SC1RClick$]


thanx again for all your replies (and sorry I took so long to reply :)
Creat