Reading Shortcut Flags Thread last updated on 2004-01-15 12:40:25

Posted by member 97484 on 2004-01-13 15:44:37

Quick Question: How do you read a shortcut's flag?

As in I want to "read in" if a certain shortcut is hidden or not and do either/or depending; in a !bang.

Posted by member 1 on 2004-01-13 16:05:25 link

have the shortcut set a mzscript variable when the shortcut is shown/hidden

Posted by member 97484 on 2004-01-14 03:24:25 link

I tried that:

*NetLoadModule mzscript-0.8.6l
noVWMBar false


In shortcut:

[!varSet noVWMBar "true"]


And the bang that uses the var

*Script bang !Desktop3
*Script gotoif ("noVWMBar" = "true") exit_prog
*Script gotoif ("noVWMBar" = "false") do_prog
*Script label do_prog
*Script exec !shortcutgroupshow 602 604 605
*Script exec !shortcutgrouphide 601 603 606
*Script exit
*Script label exit_prog
*Script exit
*Script ~bang


And it doesn't work.. what am I doing wrong?

~ Boli

Posted by member 1 on 2004-01-14 03:59:37 link

yer default is wrong...need to define the evar to mzscript and not LS. you also prolly need mzscriptusestep or whatever it is. I also think *Script exit isn't valid...it should just end. so...

*Script bang !Desktop3
*Script gotoif ("noVWMBar" = "true") end
*Script exec !Shortcutgroupshow 602 604 605
*Script exec !Shortcutgrouphide 601 603 606
*Script label end
*Script ~bang

Posted by member 97484 on 2004-01-14 06:15:06 link

OK.. what am I doing wrong:

Declaration
*Script start !varset


Shortcut
[!varSet noVWMBar "true"]


!bangs

*Script bang !varset
*Script var noVWMBar true
*Script ~bang
*Script bang !Desktop3
*Script gotoif ("noVWMBar" = "true") exit_prog
*Script exec !shortcutgroupshow 602 604 605
*Script exec !shortcutgrouphide 601 603 606
*Script exit
*Script label exit_prog
*Script exit
*Script ~bang


This is getting really annoying.. I have finished the basic structure of my theme apart from sorting this out.

(NB: *Script exit is a command)

Posted by member 12798 on 2004-01-14 09:41:43 link

you mixed some things up, i think... should be like this:

*Script start !varset "noVWMBar" "true"

sets up the mzscript var

*Script bang !Desktop3
*Script gotoif ("noVWMBar" = "true") exit_prog
*Script exec !shortcutgroupshow 602 604 605
*Script exec !shortcutgrouphide 601 603 606
*Script label exit_prog
*Script ~bang

note #1: you cannot (at least should not) redefine !varset as you did by "*Script bang !varset"

note #2: shortened the script, should work however

Posted by member 97484 on 2004-01-14 10:20:10 link

Nope that isn't working either... annoying. Am I seriously missing something here or is that code just wrong.

~ Boli

Posted by member 97484 on 2004-01-14 11:02:00 link

OK I'll try this another way:

VWMOnSwitchTo ^@#d^VWMOnSwitchTo^@dc^^@#d^
VWMOnSwitchTo1 !Desktop1
VWMOnSwitchTo2 !Desktop2
VWMOnSwitchTo3 !Desktop3


That is the code that calls the !bangs Basically when I change my desktop those !bangs should happen UNLESS [!varSet noVWMBar "true"] is called by a shortcut.

Anymore input i.e. shall I save you space at the wall I'm banging my head against?

Posted by member 1 on 2004-01-14 11:49:36 link

oops...I rewrote that wrong last night...of course it isn't working. Guess thats what I get for doing scripting at 4AM. Ah well...here goes.

*Script bang !Desktop3
*Script gotoif ("%{noVWMBar}" = "true") exit_prog
*Script exec !shortcutgroupshow 602 604 605
*Script exec !shortcutgrouphide 601 603 606
*Script label exit_prog
*Script ~bang


Warning: I have only been up for about 10 minutes so if it doesn't work thats why. :p

Posted by member 97484 on 2004-01-14 18:21:12 link

Yeah it works... only 24,000 more bugs to iron out!

incidentally it didn't work at first time so I upgraded from mzscript-0.8.6l to mzscript-0.9-beta_12. Now it all wseems to work *crosses fingers*

~ Boli

Posted by member 1 on 2004-01-14 19:34:28 link

yah...that would probably be because of the change in variable setup. You should be great with beta12 jam 4

Posted by member 12798 on 2004-01-15 05:10:06 link

doh, i simply missed the "%{}" around the var... :D

Posted by member 1 on 2004-01-15 12:40:25 link

so did I...no worries :)