How exactly does one use lsmath? Thread last updated on 2004-08-08 19:31:07

Posted by member 12025 on 2004-08-07 11:01:40

OK, so you got !mathfile, !mathequation, !mathsave.
-So you set the file.
-Then you can do stuff to variables.
-Then you can save the file.

But...
What gets saved with !mathsave? It sure doesn't save the variable that's had anything done to it (allegedly)!
; in themevars.rc
test 3

Then in lsxcommand,
!mathfile "$ConfigDir$themevars.rc"
!mathequation test = test * test
!mathsave

...themevars.rc's "test" variable still reads 3.


...OR is there some way to use another module to do expressions like that (aside from lsxcommand, as it has no real power in this case, AFAIK)?

Posted by member 37809 on 2004-08-07 12:16:33 link

no idea; it looks like a specialty module easily used only by its author.

I ignored the module entirely realizing it's not designed for runtime calculations, with its writing to file. I didn't really try to understand it, looked like a waste of time.

It's funny though if you wanted to do it dynamically. Either !reload or read the file using xLabel after it's written if ever you figure how it works...

Something bangable with mzscript would be nicer I'd agree.

Evar arithmetic while ugly with mzscript works decently.

What difficult expressions do you need to evaluate?

I've noted that Smurth defines evars for trig functions at various values...

Posted by member 12025 on 2004-08-07 12:49:19 link

Evar math w/ mzscript?
(rummages through readme)
Ah! Yup, that'll do it. %# stuff %#.
Just need +, -, *, / and () for order of operations. I have some scripts that are getting pretty large. FI, until a couple minutes ago, this was 11 lines
*script exec !varSet VWMWidth %# %{VWM_desk_width} * %{VWMDesksX} %#
*script exec !varSet VWMHeight %# ( %{VWM_desk_width}*%{VWM_desk_ratio} ) * %{VWMDesksY} %#
*script exec !varSet vwmBoxHeight %# %{VWMHeight} + %{vwmBorderTop}+%{vwmBorderBottom} %#
*script exec !varSet vwmBoxWidth %# %{VWMWidth} + %{vwmBorderLeft}+%{vwmBorderRight} %#
It's basically the same as previous themes, but I'm adding options, and so also adding a ton more variables. The taskbar scripts I wasn't even about to try until having a solution to the problem of massive amounts of lines.

Posted by member 3861 on 2004-08-08 19:31:07 link

I did write it for myself, and it does work on my system as well as some other people who used it. You need to use the newest version though, the older ones are pretty useless.

I had tried to make it entirely dynamic, but the evar system would need to be rewritten to take advantage of that(!varSet isn't dynamic either). I am waiting for 24.7 to go final before I look into the evar system.