Adding command line arguments to a quick launch icon evar? Thread last updated on 2004-07-02 22:13:36

Posted by member 177827 on 2004-07-01 18:14:58

Is it possible to add arguments to quick launch evars? I'm not sure what the syntax would be if it's possible. I've tried adding it before and after the variable declaration (in evars) as well as in the actual usage in themevars. Here's what I'm trying to do:

I've got an SSH client, PuTTY so I can connect to a very few specific machines. PuTTY accepts command line arguments. For example, I can "putty.exe 192.168.1.129 22" to ssh to port 22 on 192.168.1.129 ... I'd like to set this capability up for those few computers at the click of a button in litestep.

Possible?

Posted by member 37809 on 2004-07-01 21:07:49 link

You might even have to exhaust the quote characters.
Quotes can be tricky.

ALPHA '"c:\program files\other\putty.exe" -load alpha'

(Personally I have PuTTY in my path and I use hotkeys to call putty directly; evars aren't needed IMO since SSH is text-based and so my hands are already at the keyboard)

Just try all combinations wherever you need it, a hotkey, shortcut, etc. one of them is bound to work:

$ALPHA$
'$ALPHA$' (should be same as "$ALPHA$")
!execute [$ALPHA$]
!execute ['$ALPHA$']

That way, you don't have to recall how quotes work.
At the end of the day, whatever works, works.
But kudos if you do remember these sort of things.

Posted by member 99 on 2004-07-01 23:54:38 link

!execute [$ALPHA$] doesn't do any good unless the module in question has special behavior for !execute, which afaik none do.

Posted by member 37809 on 2004-07-02 07:17:16 link

True, I try !execute [] as a desperate last-resort heuristic for another way to group words when things don't seem to work :D

I think only layercut might do something special; it requires wrapping actions in two !execute []'s in deprecated support of both a left and right -click action for shortcuts.

Some themers wrap all actions in an !execute [] out of habit though, perhaps out of it being more readable, memorable or easily edited to add more actions--all small details.

Posted by member 177827 on 2004-07-02 18:28:01 link

Hrmmm ... I've tried something along these lines:
$ALPHA$ action
$ALPHA action$
'$ALPHA$ action'
'$ALPHA action$'
'$ALPHA$' action
inside of every evar group I can think of, but I can't get it to work. It seems to me, litestep actually looks for whatever you have in your evar as an entire program name. Fine, so I try it when it's called using similar syntax. Then it looks for your program name as a variable plus your quoted characters added to it. That amounts to the same thing.

This may not be possible to do with litestep.

Posted by member 37809 on 2004-07-02 19:13:14 link

I don't know what you're doing since you're not showing us everything.

Here's an example I tried that works fine.
FoobarPath "e:\foobar2k\foobar2000.exe"

maudioctrl_main '"$FoobarPath$" /command:"Foobar2000/Activate or hide"'

*Popup "toggle foobar" $maudioctrl_main$

Posted by member 177827 on 2004-07-02 19:40:50 link

Not quite sure I follow that example.

My first post shows exactly what I'm trying to do, though. I want PuTTY to launch with command line argument. This'll connect it directly to the system in question (I only have about 3 systems I need to putty into, so this is a good, easy solution if it works).

So, I would like a quick-launch icon that would issue the DOS command:
c:/system/putty.exe 192.168.1.128 22
But I can't seem to get the extra arguments to be read as arguments instead of a program name.

Posted by member 37809 on 2004-07-02 21:40:58 link

I don't know what you mean by a quick launch evar.

I'm guessing you're using the theme called austerity?
If so, are you modifying iconic "quicklaunch" shortcuts?

(Where are you trying to issue the command?)

If by "quicklaunch evar" you mean an evar in $PersonalDir$evars.rc, you can't expect to define any of those with arguments because when used in themes, the evars are assumed to be quoted (to preserve paths containing spaces) and so will not be separated as the program path and any arguments. I guess it's an issue of constraints on the use of strings in litestep.

In order to get them working the way you want, you have to make the adjustment like in my previous example:
*Popup "toggle foobar" $maudioctrl_main$

Note the evar there isn't quoted. I guess in this way, you preserve the separation of program path and arguments. I'm not sure if this would work everywhere though.

Posted by member 103254 on 2004-07-02 21:53:42 link

How about doing a normal windows shortcut (.lnk) in a folder somwhere, then set the target to

c:/system/putty.exe 192.168.1.128 22

And use a LS shorctut to start that?

Or even a batch to file to run

c:/system/putty.exe 192.168.1.128 22

and have a LS shortcut to the .bat?

Posted by member 37809 on 2004-07-02 21:56:34 link

Yes, that should work. You create windows shortcuts to PuTTY and modify those to contain the arguments (and then define evars which point to these shortcuts).

Posted by member 177827 on 2004-07-02 22:13:36 link

Sorry, yes, I did mean in austerity. I've tried a couple themes, but keep coming back to this one just for basic simplicity. And yes, I did try issueing the command in the evars.rc file and found exactly what you said, that the spaces were quoted as part of the file name. I also tried in the quicklaunch_icons.rc but no luck there either.

Good call on the batch file or link. I should have thought of that first. Guess I've been messing with linux config files too long, want to do every config inside a text file ;).

Thanks guys!