Brainfart: A skinners tale

Wednesday, April 04, 2007

Singularity Scripts Simplified

Singularity Under The Hood
A lot has happened behind-the-scenes with relation to the Singularity v0.004 theme for LiteStep OTS2 recently. Besides the entirely new graphical front-end of the theme, much of the back-end has changed likewise, although those parts are less likely to be noticed. Here are a few of the changes:
  1. Switched from Layercuts-1.72 to xLabel-4.0.7. This was a major undertaking, as the syntax used between the two modules for rendering the desktop shortcuts and graphics is VERY different. Although I've had a hard-time learning xLabel's syntax and exactly what ties in to the xPaintClass.dll module, it's been worth it - xLabel uses less memory and does more despite the extra lines of code it takes. Setting up the instrument cluster (taskbar, VWM, and system tray) used much fewer graphics this time, although the RC coding almost quadrupled in size (and I haven't even gotten to the meters and audio module!). It renders much nimbler, however, and the theme's startup time has bee reduced as a consequence.
  2. Taskbar went from Taskbar3.dll to xtaskbar-2.0.2. Man, what a cool module! Infinitely versatile, I don't think I'll ever use anything else again.
  3. The System-Tray went from the previous installer-bundled tray module to xTray-1.1.1, again, going with the trend for the latest xModules where I can. No extra icon effects at the moment, because I feel the natural colors and saturations of the icons provide a better visual cue as to what they actually are, although an option for recolorization may be included.
  4. Many RC configurations have been off-loaded from the THEME.RC file to auxiliary files in the CONFIG directory. I used to hate it when themers did this, because it made things harder to find sometimes. Having a tabbed text-editor with great syntax highlighting has largely resolved this for me, though.
  5. Popup variations - 3 of them. I've already shown how these guys look. The scripts to change them, however, have been updated using the new xTextEdit module, whose !xTextSaveEvar bang (LiteStep command) has greatly simplified my life.
So with that said, here is a list of of the currently installed and working modules:
  • xPaintClass-1.0
  • xLabel-4.0.7
  • mzscript-0.8
  • jdesk-0.73
  • xpopup-1.3.1
  • xtaskbar-2.0.2
  • xtray-1.1.1
  • rabidvwm-1.2.1i
  • lsxcommand-1.9.4
  • ckhotspots-2.3.3
  • xtextedit-0.6
Scripts updated
Another major task in progress is to simplify the scripts present in the theme. A little secret for anyone reading: I suck at coding. That's right, I'm a really crappy, brute-force style programmer with no panache or elegance. It really showed in the previous scripts. The updates make it marginally easier to see what's going on. XLabel's Groups functions have really made this possible. Here's an example of what the script for changing the Instrument module's Z-order used to look like:

;_____/ Toggle bar Z-Order script \_____
*script bang !ToggleTopBar
*script gotoif ("%[_topzorderstate]" = "ontop") tbmove2bottom
*script gotoif ("%[_topzorderstate]" = "desktop") tbmove2top
*script label tbmove2bottom
;==>Move bar elements to bottom z-order.
*script exec !shortcutgrouponbottom 1
*script exec !systrayontop
*script exec !vwmtoggleontop bottom
*script exec !shortcutgrouponbottom 5
*script exec !shortcutgrouponbottom 6
*script exec !shortcutgrouponbottom 7
*script exec !shortcutgrouponbottom 8
*script exec !shortcutgrouponbottom 9
*script exec !shortcutgrouponbottom 10

;==>Ensure that command is hidden & correct btn shown.
*script exec !ifEq _cutsbarstate "expanded" !shortcutgroupshow 8
*script exec !ifEq _cutsbarstate "contracted" !shortcutgrouphide 8
*script exec !shortcutgrouphide 9
*script exec !commandhide

*script exec !varSet _topzorderstate "desktop"
*script exit

*script label tbmove2top
;==>Move bar elements to top z-order.
*script exec !shortcutgroupontop 1
*script exec !shortcutgroupontop 5
*script exec !shortcutgroupontop 6
*script exec !shortcutgroupontop 7
*script exec !shortcutgroupontop 8
*script exec !shortcutgroupontop 9
*script exec !shortcutgroupontop 10

;==>Ensure that command is hidden & right btn shown.
*script exec !ifEq _cutsbarstate "expanded" !shortcutgroupshow 8
*script exec !ifEq _cutsbarstate "contracted" !shortcutgrouphide 8
*script exec !shortcutgrouphide 9
*script exec !commandhide

*script exec !systrayontop
*script exec !vwmtoggleontop yes
*script exec !varSet _topzorderstate "ontop"
*script ~bang


Here's what it looks like now:

;_____] New Toggle Instruments Zorder script [_____
*script bang !ToggleInstrumentZ
*script exec !vwmtoggleontop
*script exec !xtrayalwaysontop toggle
*script exec !xtaskbaralwaysontop toggle
*script exec !labelalwaysontop Instruments toggle
*script exec !ifEq _instz "ontop" !varSet _instz "desktop"
*script exec !ifEq _instz "desktop" !varSet _instz "ontop"
*script ~bang


It's amazing what a few years experience can do. Regardless, I'm still less-than-average when it comes to the coding aspect of this, so any expertice or suggestions are appreciated.

What's Next
Here are a few of my current to-do items on the theme:
  • Create separators for the pop-up menus.
  • Tweak the existing taskbar drop-shadows slightly.
  • Create 2 more task-bar styles that can be dynamically selected on the fly.
  • Get the System Meters working, either through xStatsGraph or RainMeter.
  • Select an appropriate audio module and get it working through the desktop shortcuts.
  • Finish polishing up the scripts.
  • Add the afore-mentioned color themes to this version of singularity.

Labels: , ,

4 Comments:

  • interestingly enough the current theme im tweaking uses *NetLoadModule gandharva-0.50.0.4.dll and uses the label module to skin and control it with !bangs.
    check it out, its the REFLECTION theme.

    By Anonymous Anonymous, at 6:56 AM  

  • !mulestem,

    Where do you have your REFLECTION theme posted at? I'm trying to locate a copy to see what you did under the hood :)

    By Blogger mrbiotech, at 3:25 PM  

  • http://www.litestep.net/index.php?section=2&action=details&id=1289
    well its not actually mine, im just tweaking it. :)

    By Anonymous Anonymous, at 2:36 PM  

  • http://www.litestep.net/
    index.php?section=2&action=
    details&id=1289

    GRRRRRRRR......>:[

    well its not actually mine, im just tweaking it. :)

    By Anonymous Anonymous, at 2:38 PM  

Post a Comment

<< Home