Handy rehooking Thread last updated on 2004-07-22 04:56:49

Posted by member 12025 on 2004-07-16 21:35:36

In the theme.rc
*NetLoadModule "xLabelLight-3.1" load "xlabelLight-3.1.dll"
*NetLoadModule "mzscript-0.9-beta_12"
*NetLoadModule "timer-0.5"
(xLabel will also work, from 2.9 to 3.1)
; step rc file
*timer reload_this p 50 !reload_this_part_2

; script file
*script bang !reload_this ; \hide bang:module labelname:endbang
*script exec %{\1:}
*script exec !varSet tmp %{\2}
*script exec !LabelDestroy %{\2:}
*script exec !varsaveall
*script exec !reload
*script exec !netReloadModule %{\1:_}
*script exec !timerstart reload_this
*script ~bang
*script bang !reload_this_part_2
*script exec !LabelCreate %{tmp:}
*script exec %{tmp:_}
*script ~bang

example:
!reload_this "!xTaskbarHide:xtaskbar-1.0" "taskBox:!taskbar_resize_for_real"

This hides the module, as some don't like being reloaded while being shown, saves new settings, kills the label, reloads the module, then remakes the label, hooking the module again. I may get brave in the next couple days and get it working with multiple hooked modules per xlabel. The endbang may sometimes not be needed, and in some cases, may simply need to be a show/focus bang, like !vwmshow or !commandfocus.

Without the timer, the label and module get reloaded, but the module isn't hooked (that kept happening with the script RabidCow began and posted).

-Cerbie, gettin' medieval on my !recycles.

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

interesting. a big step closer to a recycleless theme.

Posted by member 12025 on 2004-07-22 04:56:49 link

Well, check out Hymn 43 2.2.1 there in the themes section.
Now imagine that theme has less than half, if not a fourth, of the options I want to be able to set per box, and I've got three more modules I'm adding in (xTaskbar, clockwork, lssliderfoo, and a more customizable system monitor box), and am getting working in its successor theme. Some things will just be acts of futility without recycles (changing the entire theme's style is just going to take a recycle--and I don't mean color, as that should be possible w/o recycling), but I want everything I can to be done recycless(sp).
Once my PC is up and running (only spare vid card I found was a S3 Trio64...it's a drivers nightmare!), I'll work on multiple hooked modules (using cut-down versions of tnl's list bangs) and chaining them together for multiple levels of rehooking if I can.

If the multiple layers of hooks work, I may in fact be able to do it all without a true !recycle. Even if it means reloading every single module, that's still faster than a !recycle (I'm guessing a !recycle is more HDD bound than !reload and then !netreloadmodule lines).

I will also be testing out how well the timer works with low delays. If just having a delay is enough, and say, 10ms does the trick, it should be quite a bit speedier.

==========

Edit: OK, forget imagining. Here's what I *will* have in the first release:
-VWM: 16-60 in 4px steps VWM workspace width, with 1:1, 5:4, 3:4, 16:9, and 1:2 aspect ratios for the desks. 1-16 desks across, 1-16 desks down. The color and style of the VWM miniwindows and selected desktop are independent of the rest of the theme's color choices.
-Tasks: floating taskbar, hugging a side (filling width/height), autohiding on a side, hugging a side and changing desk area to accomodate it (like any taskbar). The taskbar may add tiles up, down, left, right, and to however many per line as selected (currently 1-20). Minimum and maximum width selections as well, possibly height. Also, tiles of various states may have different visual settings, like the VWM.
-Amp/command/sliders: single bar, one row, with lsxcommand on one side, dynamp controls on the other. Height/width variable. Or a three-row box, with lsxcommand at the top, sliders in the middle, controls on the bottom. OR three separate boxes for them, each independent of the other, and can be loaded or not loaded individually.
-Tray: resizable box as always. I think I cna get it going left and/or up properly, as well.
-Clock: a ghosted analog clock. Not sure on more.
-XProp: like Hymn 43.
-System monitor box: similar configs to Hymn 43 2.2, but may display any of (parenthetical text optional) CPU use (speed text), RAM use (MB text), swap use (MB text), network in/out (? text), various votlages and fan RPMs.

All: separate styles. The style selected decides the images used, their stretch borders, and their padding on all sides for the modules. There are five styles going in, two more I might add. The current five all have the same color selections, so they are easy to work in together. One mimics Hymn 43, but has a 1px border option; one has a single thin (5px) grip on one side; one has thin grips on opposite sides; one has a single thick grip (10px); one has thick grips on opposite sides.
All displayed boxes have the option of right, middle, or left clicking (this currently works, off/left/middle/right) to shade the box, so only the grip shows, and it acually moves it so if the grip for that box happens to be on the right or bottom, it is moved appropriately, and changed back properly when unshading. This was something that was impossible to do with LsBox on any box that might dynamically change size and position.
If left click shades, middle click drags, if middle click shades, left drags, if right shades, left drags (the leftover button brings up the options for that box).
Each box has its own always on top setting.

Maybies:
-Taskbar and system tray combined into the same box when having the taskbar on a side. I think I can do it, but with everything having to fit with everything else, it might end up tough...but it could be dead simple.
-Getting the tray, going one direction and wrapping another, may not do so well going up and left, and I think I can live with that if my current ideas for dealing with it don't work.
-Weather
-RSS
(the last two depending on time and ease of implementing)

...and the thing is, a suprising amount of those features are already working, just in a you-must-manually-input-bangs-all-the-time kinda way.
xLabel and xTaskbar alone are letting me do things I have wanted to do for over a year now. I've had all this stuff in my head since I first saw Vodka Martini, and now I can finally do it, with no major compromises(sp).