module queue in simplicity Thread last updated on 2003-07-10 22:17:44

Posted by member 47042 on 2003-07-09 09:46:38

i've been reading through the docs and forums, but can't seem to find anything on this, so hopefully i didn't just overlook it.

i'm trying to figure out how to cycle through the module queue:
• VWM & system status
• system tray
• winamp controls & status
• command line,

using hotkey commands. right now there are the arrows on either side to cycle through, but i would really like to be able to do this through a keyboard shortcut.

Posted by member 1 on 2003-07-09 10:33:28 link

You want to find those shortcut configs and apply them to hotkeys. Unfortunatly you aren't going to be able to walk through the settings like you do now, you are going to hop right to the one you want because those shortcuts actually hide when you click on them. Good luck.

Posted by member 1316 on 2003-07-09 12:20:28 link

yeah, you'll probably have to do four different hotkeys. one to show vwm/system status, and to hide everything else. another one to show system tray, and to hide everything else, etc. if you don't need one of the modes hotkeyed, then don't do that one. you'll still be able to get to it through the arrows, if you really need to.

Posted by member 37809 on 2003-07-09 18:41:29 link

This may best be done with some sort of scripting, personally preferably with mzscript (stable or not).

Use a state variable that keeps track of the current view. To change views, you can request a new view and hide the old view. (I feel this way is smoother than hiding old and then showing new).

This simply (not the best?) designed script I present (for mzscript v0.9 etc) uses one numerical variable that holds the index of the queue's views. You could do something like the following (which is Updated: tested and working, fairly understandable and pluggable w/ your text)

*script bang !queue_prev
*script exec !varset newview %{curview}
*script exec !varadd newview -1
*script exec !queue_refresh
*script ~bang

*script bang !queue_next
*script exec !varset newview %{curview}
*script exec !varadd newview 1
*script exec !queue_refresh
*script ~bang

*script bang !queue_refresh
; wrap view
*script exec !ifeval ("%{newview}" < "1") '|varset newview 4'
*script exec !ifeval ("%{newview}" > "4") '|varset newview 1'

*script gotoif ("%{newview}" = "2") show2
*script gotoif ("%{newview}" = "3") show3
*script gotoif ("%{newview}" = "4") show4
*script goto show1 ; case to catch all

*script label hide
*script gotoif ("%{newview}" = "%{curview}") done
*script gotoif ("%{curview}" = "1") hide1
*script gotoif ("%{curview}" = "2") hide2
*script gotoif ("%{curview}" = "3") hide3
*script gotoif ("%{curview}" = "4") hide4

*script label save
*script exec !varset curview %{newview}
*script exec !varsave curview
*script label done
*script exit

; vwm, system status
*script label show1
*script exec !bangsToShowEtc
*script goto hide
*script label hide1
*script exec !bangsToHideEtc
*script goto save

; system tray
*script label show2
*script exec !bangsToShowEtc
*script goto hide
*script label hide2
*script exec !bangsToHideEtc
*script goto save

;etc
*script label show3
*script exec !bangsToShowEtc
*script goto hide
*script label hide3
*script exec !bangsToHideEtc
*script goto save

;etc
*script label show4
*script exec !bangsToShowEtc
*script goto hide
*script label hide4
*script exec !bangsToHideEtc
*script goto save

*script ~bang

*script start !execute [!exec |varset newview %{curview}][!queue_refresh]


Have curview as a variable in a file, and of course add and modify the code as necessary. It is assumed that you have everything hidden initially.

Posted by member 910 on 2003-07-09 22:45:28 link

there's an easier way to do this using lists in mzscript. the code i'm putting isn't going to be exact, i haven't done it in a while, and mzscript has changed a bit lately, but you'll get the idea.

*script var Queue "!Execute [!systrayShow][!VWMHide]:!Execute [!labelShow][!systrayHide]:!Execute [!vwmshow][!labelHide]"

*script bang !QueueAdvance
*script exec %{Queue:}
*script varset Queue %{Queue:_}:%{Queue:}
*script ~bang

Posted by member 910 on 2003-07-09 22:47:33 link

Another way to do it would be to use jukeys, i think it is, that allows you to select "groups" of hotkeys. Just have the same hotkey defined in however many groups you need, and switch groups with the hotkey. like group 1 Win+A would hide the vwm and show the systray and switch to group 2, and group 2 Win+A would hide the systray and show the label, etc etc

Posted by member 37809 on 2003-07-10 00:04:01 link

Yes, I'm an mzscript fiend ;0
Combining pika's suggestion with my excessiveness, and also with disclaimer of mzscript version differences:

Again have everything initially hidden. Then have bangs:
!hide_vwmsys, !show_vwmsys, etc, for each of the items in:

*script var queue vwmsys:tray:amp:cmdline

Then try the following, which allows for two-way queue advancing. Letting the data structure do all the work isn't nearly as fun :p

*script bang !queue_prev
*script exec !hide_%{queue:}
*script exec !varset working %{queue}:end
*script exec !varset notlast ""
*script label loop
*script exec !varset last %{working:}
*script gotoif ("%{working:_}" = "end") done
*script exec !varset notlast %{notlast}:%{last}
*script exec !varset working %{working:_}
*script goto loop
*script label done
*script exec !varset queue %{last}%{notlast}
*script exec !show_%{queue:}
*script exec !varremove working
*script exec !varremove notlast
*script exec !varremove last
*script ~bang

*script bang !queue_next
*script exec !hide_%{queue:}
*script exec !varset queue %{queue:_}:%{queue:}
*script exec !show_%{queue:}
*script ~bang

*script start !exec |show_%{queue:}


If you wanted you could combine some more. The first script I suggested is more self-contained than this one and allows for you to select any one view by setting the variable newview to the index and calling !queue_refresh

Posted by member 37809 on 2003-07-10 14:20:58 link

So only now do I download simplicity, off of the litestep installer site.
...
A quick scan through the script.rc leaves you with !mod_next and !mod_prev, so try those.

Posted by member 910 on 2003-07-10 22:17:44 link

excessive testing. if you know how many show / hide pairs you have, just cycle it that many times for prev. for 3 modules:

[!systrayShow][!VWMHide]:!Execute [!labelShow][!systrayHide]:!Execute [!vwmshow][!labelHide]

*script var mod_num 3

*script var Queue "!Execute [!systrayShow][!VWMHide]:!Execute [!labelShow][!systrayHide]:!Execute [!vwmshow][!labelHide]"

*script var Queue_rev "!Execute [!labelShow][!vwmHide]:!Execute [!systrayShow][!labelHide]:!Execute [VWMShow][!SystrayHide]"



*script bang !QueueAdvance
*script exec %{Queue:}
*script varset Queue %{Queue:_}:%{Queue:}

*script !varset loop_num 1
*script varset Queue_rev %{Queue_rev:_}:%{Queue_rev:}
*script !varAdd loop_num 1
*script gotoif ( %{loop_num} != %{mod_num} ) EndLoop

*script ~bang


*script bang !QueuePrev
*script exec %{Queue_rev:}
*script varset Queue_rev %{Queue_rev:_}:%{Queue_rev:}

*script !varset loop_num 1
*script varset Queue %{Queue:_}:%{Queue:}
*script !varAdd loop_num 1
*script gotoif ( %{loop_num} != %{mod_num} ) EndLoop

*script ~bang