View unanswered posts | View active topics It is currently Thu May 23, 2013 5:08 am



Post new topic Reply to topic  [ 14 posts ] 
 0.70 styling syntax tutorial 
Author Message
Site Admin
User avatar

Joined: Sat Dec 11, 2004 10:51 pm
Posts: 102
Location: pittsburgh, pa
Reply with quote
Post 0.70 styling syntax tutorial
BB Style 0.70 Syntax Tutorial
by snkmchnb (snkmchnb.at.lost-ip.info)

This is my first attempt at a tutorial of any kind and most of the information if not all will be from the Blackbox sourceforge site, http://blackboxwm.sourceforge.net. This tutorial will take you step-by-step in styling for blackbox using the new style syntax and if you've made styles for blackbox before and are used to the old syntax you can skip to the end where I'll have a full template of the new syntax available.

Tip: If you're using fluxbox, openbox, hackedbox, and bb4win these rely on the older style syntax. I suggest you take a look at the style tutorial made by thewayofzen for this syntax. BBLean can use either syntax and xoblite can do the new borders, border colors and border widths from the latest syntax.


1. Texture:

A texture is a description of a particular visual element. It
consists of a text description, colors and a border width. Textures
are specified as follows:

<name>.appearance: description
<name>.backgroundColor: background color for solids
<name>.color1: initial color for gradients and interlaced solids
<name>.color2: target color for gradients and interlaced solids
<name>.borderWidth: width of the texture border in pixels
<name>.borderColor: color of the texture border

The BNF for the appearance is:

<appearance> := parentrelative | [<bevel-type>] [<fill-type>] [interlaced] [border]
<bevel-type> := sunken | flat | raised
<fill-type> := gradient <gradient-type> | solid
<gradient-type> := crossdiagonal | rectangle | pyramid | pipecross |
elliptic | horizontal | vertical | diagonal


Remember this syntax, it's the base for the toolbar, menu, slit and windows.

2. Color:

Ways to define colors such as Hex, HTML and X11 color names (e.g. cornsilk3), rgb or rgbi, or as a device-independent color specification. To keep it simple I'll be doing the tutorial in Hex.


3. Alignment:

Alignment is one of the following: Left, Center and Right. Pretty straight forward.


4. Width/Height/Margin:

All width, height and margin resources are specified in pixels. In
general, width and height specify the full extent, where as margin
specifies the space around another element.
5. Starting a style:

Normally at the top of a style you will see either a commented or syntax defined section giving a description of the style and some information such as name, author, date, etc.

I've seen comments with “;” and “!”, personally I've always used “!” and it works fine. This is normally the way you'll see it done with syntax:

Code:
style.name:
style.author:
style.date:
style.credits:
style.comments:


Time to get down to the nitty gritty.

6. Toolbar:

The toolbar is normally on the bottom of the screen but can also be positioned at the top of the screen as well. The toolbar consists of four main elements: label (for workspaces or virtual desktops), buttons, winlabel (active window title) and clock.


A. Toolbar

The toolbar's main appearance is defined with the following syntax:

Code:
toolbar.appearance: (toolbar texture)
toolbar.backgroundColor: (toolbar color if fill-type is solid)
toolbar.color1: (starting gradient color)
toolbar.color2: (ending gradient color)
toolbar.borderColor: (toolbar border color)
toolbar.borderWidth: (border width in pixels)
toolbar.alignment: (toolbar font alignment for label, windowlabel and clock)
toolbar.font: (font used in toolbar)
toolbar.marginWidth: (margin between elements measured by pixels)


Now if you recall from above the options for the appearance would be: parentrelative, raised, flat and sunken.

Tip: You will not want to set the toolbar's appearance to be parentrelative due to the fact that it is not a child element of another object. This means that it would not have any colors defined and thus would default to blackbox's default settings, normally flat solid black and white.

The toolbar would be set to either raised, flat or sunken. The next option defined in that same line would be the fill-type (gradient or solid). If gradient is chosen then the gradient-type also needs to be defined. Gradient-types include: crossdiagonal, rectangle, pyramid, pipecross, elliptic, horizontal, vertical, and diagonal.

The interlaced option can also be included which basically darkens every other line in a gradient which can lead into a really nice effect. The final option would be the bevel level; choices are bevel1 and bevel2. Again this is all preference but can help a style pop a little more by giving it a little more definition. The bevel should only be used with either the raised or sunken appearance.


B. Buttons

There are two different declarations for buttons that you have to make for the toolbar (3 for the buttons on the windows), style of buttons when they arn't being used and when the buttons are pressed. The syntax is as follows:

Code:
toolbar.button.appearance: (button texture)
toolbar.button.backgroundColor: (button color if using solid; omit !)
toolbar.button.color1: (starting gradient color)
toolbar.button.color2: (ending gradient color )
toolbar.button.borderWidth: (button border thickness in pixels)
toolbar.button.borderColor: (button border color)
toolbar.button.foregroundColor: (color of arrow on button)
toolbar.button.marginWidth:  (margin around arrows in buttons measured in pixels)

toolbar.button.pressed.appearance:
toolbar.button.pressed.backgroundColor:
toolbar.button.pressed.color1:
toolbar.button.pressed.color2:
toolbar.button.pressed.borderWidth:
toolbar.button.pressed.borderColor:
toolbar.button.pressed.foregroundColor:


Notice that there is also the sunken part of the syntax which you declare a separate style for the buttons when clicked. Generally this would either be declared as sunken or a different color set to show the action of the buttons being clicked.


C. Clock

The clock resides on the right-most side of the toolbar. The clock and label also have the same size as far as width. The clock's style syntax is as follows:

Code:
toolbar.clock.appearance: (clock texture)
toolbar.clock.backgroundColor: (clock color if fill-type is solid)
toolbar.clock.color1: (starting gradient color)
toolbar.clock.color2: (ending gradient color)
toolbar.clock.borderWidth: (clock border width measured in pixels)
toolbar.clock.borderColor: (clock border color)
toolbar.clock.textClolor: (clock text color)


D. Label

The label is the section of the toolbar that displays the names of workspaces (virtual desktops) you are currently on. The syntax for the label is as follows:

Code:
toolbar.label.appearance: (label texture)
toolbar.label.backgroundColor: (label color if fill-type is solid)
toolbar.label.color1: (starting gradient color)
toolbar.label.color2: (ending gradient color)
toolbar.label.borderWidth: (label border width measured in pixels)
toolbar.label.borderColor: (label border color)
toolbar.label.textColor: (label text color)
toolbar.label.marginWidth: (margin around text in label measured in pixels)



E. Window Label

The window label is located in the center of the toolbar and displays the currently active application which has focus. The windows label style syntax is as follows:

Code:
toolbar.windowLabel.appearance:
toolbar.windowLabel.backgroundColor:
toolbar.windowLabel.color1:
toolbar.windowLabel.color2:
toolbar.windowLabel.borderWidth:
toolbar.windowLabel.borderColor:
toolbar.windowLabel.textColor:



F. Toolbar example

Now since the buttons, clock, label and window label are part of the toolbar, they would be considered child elements of the toolbar and would be able to be parentrelative of the toolbar, or inherit the style that of the toolbar. Here is an example of how I've done my toolbar:

Code:
toolbar.appearance: raised gradient vertical
!toolbar.backgroundColor:
toolbar.color1: #ffffff
toolbar.color2: #c0c0c0
toolbar.borderColor: #333333
toolbar.borderWidth: 1
toolbar.alignment: center
toolbar.font: mints-strong
toolbar.marginWidth: 3

toolbar.button.appearance: raised gradient vertical
!toolbar.button.backgroundColor:
toolbar.button.color1: #c0c0c0
toolbar.button.color2: #777777
toolbar.button.borderWidth: 1
toolbar.button.borderColor: #333333
toolbar.button.foregroundColor: #ffffff
toolbar.button.marginWidth: 3

toolbar.button.pressed.appearance: sunken gradient vertical
!toolbar.button.pressed.backgroundColor:
toolbar.button.pressed.color1: #c0c0c0
toolbar.button.pressed.color2: #ffffff
toolbar.button.pressed.borderWidth: 1
toolbar.button.pressed.borderColor: #333333
toolbar.button.pressed.foregroundColor: #333333

toolbar.clock.appearance: parentrelative
!toolbar.clock.backgroundColor:
toolbar.clock.color1: #ffffff
toolbar.clock.color2: #c0c0c0
toolbar.clock.borderWidth: 1
toolbar.clock.borderColor: #333333
toolbar.clock.textColor: #333333
toolbar.clock.marginWidth: 3

toolbar.label.appearance: parentrelative
!toolbar.label.backgroundColor:
toolbar.label.color1: #ffffff
toolbar.label.color2: #c0c0c0
toolbar.label.borderWidth: 1
toolbar.label.borderColor: #333333
toolbar.label.textColor: #333333
toolbar.label.marginWidth: 3

toolbar.windowLabel.appearance: sunken gradient vertical
!toolbar.windowLabel.backgroundColor:
toolbar.windowLabel.color1: #c0c0c0
toolbar.windowLabel.color2: #ffffff
toolbar.windowLabel.borderWidth: 1
toolbar.windowLabel.borderColor: #333333
toolbar.windowLabel.textColor: #333333


Notice that the .backgroundColor parts of elements above a “!” in front of it. This is due to the fact that I'm using a gradient instead of solid color. You can also do a solid by declaring a gradient but using the same color for color one. Since I'm also doing gradients here the .backgroundColor is not needed but I'm keeping all of the syntax included for good practice.


7. Menu

The menu is comprised of 3 main elements, the title, frame and active portions.

A. Title

The menu title is the top-most element you'll see in the menu. It generally will be the name of a submenu. Style syntax for the menu title is as follows:

Code:
menu.title.appearance: (menu title texture)
menu.title.backgroundColor: (background color of menu title if solid)
menu.title.color1: (starting gradient color)
menu.title.color2: (ending gradient color)
menu.title.borderWidth: (menu title border width measured in pixels)
menu.title.borderColor: (menu title border color)
menu.title.foregroundColor: (color of bitmap element, ie close button)
menu.title.textColor: (menu title text color)
menu.title.font: (menu title font)
menu.title.alignment: (menu title font alignment)
menu.title.marginWidth: (margin around menu title font)



B. Frame

The menu frame is the main part of the menu where all of the applications and submenus are located. Syntax for the menu frame is as follows:

Code:
menu.frame.appearance: (menu frame texture)
menu.frame.backgroundColor: (menu background color if solid texture)
menu.frame.color1: (starting gradient color)
menu.frame.color2: (ending gradient color)
menu.frame.borderWidth: (menu frame border width measured in pixels)
menu.frame.borderColor: (menu frame border color)
menu.frame.foregroundColor: (color of bitmap element for submenu, ie arrow)
menu.frame.textColor: (menu frame font color)
menu.frame.disabledColor: (font color of disabled menu option)
menu.frame.font: (menu frame font)
menu.frame.alignment: (menu frame font alignment)
menu.frame.marginWidth: (margin around text in menu measured in pixels)


C. Active

The active sections of the menu is what is currently being selected in the menu or hovered over with the mouse. Its settings are changed using:

Code:
menu.active: (menu active texture)
!menu.active.backgroundColor: (menu active color if solid texture)
menu.active.color1: (starting gradient color)
menu.active.color2: (ending gradient color)
menu.active.borderWidth: (menu active border width measured in pixels)
menu.active.borderColor: (menu active border color)
menu.active.foregroundColor: (color of bitmap element for submenu, ie arrow)
menu.active.textColor:(menu frame font color)


D. Menu example

Code:
menu.title.appearance: raised gradient vertical
!menu.title.backgroundColor:
menu.title.color1: #c0c0c0
menu.title.color2: #777777
menu.title.borderWidth: 1
menu.title.borderColor:   #333333
menu.title.foregroundColor: #ffffff
menu.title.textColor: #ffffff
menu.title.font: mints-strong
menu.title.alignment: center
menu.title.marginWidth: 3

menu.frame.appearance: raised gradient vertical
!menu.frame.backgroundColor:
menu.frame.color1: #ffffff
menu.frame.color2: #c0c0c0
menu.frame.borderWidth: 1
menu.frame.borderColor: #333333
menu.frame.foregroundColor: #333333
menu.frame.textColor: #333333
menu.frame.disabledColor: #eeeeee
menu.frame.font: mints-strong
menu.frame.alignment: left
menu.frame.marginWidth: 3

menu.active.appearance: sunken gradient vertical
!menu.active.backgroundColor:
menu.active.color1: #c0c0c0
menu.active.color2: #ffffff
menu.active.borderWidth: 1
menu.active.borderColor: #333333
menu.active.foregroundColor: #333333
menu.active.textColor: #333333


8. Slit

Some people may not know what the slit is so I'm going to give a little run down before I give the style syntax for it. The slit is basically a container for dock apps (plugins in windows) and attaches to the edges of the screen.

Note: The slit in the Windows variants the slit does not recognize the new style syntax.

Code:
slit.appearance: (slit texture)
slit.backgroundColor: (slit color if solid texture)
slit.color1: (starting gradient color)
slit.color2: {ending gradient color)
slit.borderWidth: (slit border width measured in pixels)
slit.borderColor: (slit border color)
slit.marginWidth: (margin between elements in the slit measured in pixels)


9. Windows

There are two main parts of windows when styling, focused and unfocused. The elements that are defined for both parts are title, label, button, handle and grip. These elements, most of the time, are styled to mimic the toolbar elements respectfully.

A. Title

The window title is the main part of the window which contains the buttons and label. Syntax for the window title is as follows:

Code:
window.title.marginWidth: (margin around buttons and label measured in pixels)
window.title.focus.appearance: (focused title texture)
window.title.focus.backgroundColor: (focused  color if solid texture)
window.title.focus.color1: (focused starting gradient color)
window.title.focus.color2: (focused ending gradient color)
window.title.focus.borderWidth: (focused  border width measured in pixels)
window.title.focus.borderColor: (focused border color)

window.title.unfocus.appearance: (unfocused title texture)
window.title.unfocus.backgroundColor: (unfocused  color if solid texture)
window.title.unfocus.color1: (unfocused starting gradient color)
window.title.unfocus.color2: (unfocused ending gradient color)
window.title.unfocus.borderWidth: (unfocused  border width measured in pixels)
window.title.unfocus.borderColor: (unfocused border color)


B. Label

The window label displays the name of the application running. Syntax for the label is as follows:

Code:
window.label.marginWidth: (margin around text in label)
window.label.focus.appearance: (focused label texture)
window.label.focus.backgroundColor: (focused label color if solid texture)
window.label.focus.color1: (focused starting gradient color)
window.label.focus.color2: (focused endng gradient color)
window.label.focus.borderWidth: (focused label border width measured in pixels)
window.label.focus.borderColor: (focused label border color)
window.label.focus.textColor: (focused label text color)

window.label.unfocus.appearance: (unfocused label texture)
window.label.unfocus.backgroundColor: (unfocused label color if solid texture)
window.label.unfocus.color1: (unfocused starting gradient color)
window.label.unfocus.color2: (unfocused endng gradient color)
window.label.unfocus.borderWidth: (unfocused label border width measured in pixels)
window.label.unfocus.borderColor: (unfocused label border color)
window.label.unfocus.textColor: (unfocused label text color)


C. Buttons

As stated above the window buttons are styled pretty much the same as buttons on the toolbar but you also have to define the unfocused buttons as well. Style syntax for window buttons are as follows:

Code:
window.button.marginWidth: (margin around bitmap in buttons measured in pixels)
window.button.focus.appearance: (focused button texture)
window.button.focus.backgroundColor: (focused button color if solid texture)
window.button.focus.color1: (focused button starting gradient color)
window.button.focus.color2: (focused button ending gradient color)
window.button.focus.borderWidth: (focused button border width measured in pixels)
window.button.focus.borderColor: (focused button border color)
window.button.focus.foregroundColor: (focused button bitmap color)

window.button.unfocus.appearance: (unfocused button texture)
window.button.unfocus.backgroundColor: (unfocused button color if solid texture)
window.button.unfocus.color1: (unfocused button starting gradient color)
window.button.unfocus.color2: (unfocused button ending gradient color)
window.button.unfocus.borderWidth: (unfocused button border width measured in pixels)
window.button.unfocus.borderColor: (unfocused button border color)
window.button.unfocus.foregroundColor: (unfocused button bitmap color)

window.button.pressed.appearance: (pressed button texture)
window.button.pressed.backgroundColor: (pressed button color if solid texture)
window.button.pressed.color1: (pressed button starting gradient color)
window.button.pressed.color2: (pressed button ending gradient color)
window.button.pressed.borderWidth: (pressed button border width measured in pixels)
window.button.pressed.borderColor: (pressed button border color)
window.button.pressed.foregroundColor: (pressed button bitmap color)


F. Frames

At the left and right sides of the windows are the window frames. The window frames are used to open the root blackbox menu and to also separate the window contents from the background. The frames style syntax is as follows:

Code:
window.frame.borderWidth: (window frame border width measured in pixels)
window.frame.focus.borderColor: (focused window frame border color)
window.frame.unfocus.borderColor: (unfocused window frame border color)


E. Grips

The window grips are the two smaller sections at the bottom of the window, one on each end. The grips are used to resize the window. Style syntax for the grips is as follows:

Code:
window.grip.focus.appearance: (focused grip texture)
window.grip.focus.backgroundColor: (focused grip color if solid texture)
window.grip.focus.color1: (focused grip starting gradient)
window.grip.focus.color2: (focused grip ending gradient)
window.grip.focus.borderWidth: (focused grip border width measured in pixels)
window.grip.focus.borderColor: (focused grip border color)

window.grip.unfocus.appearance: (unfocused grip texture)
window.grip.unfocus.backgroundColor: (unfocused grip color if solid texture)
window.grip.unfocus.color1: (unfocused grip starting gradient)
window.grip.unfocus.color2: (unfocused grip ending gradient)
window.grip.unfocus.borderWidth: (unfocused grip border width measured in pixels)
window.grip.unfocus.borderColor: (unfocused grip border color)


F.HANDLES

The window handle is at the bottom of the window in the center of the grips. The handle is used to move the window around just as you would with the top of the window. The handle's style syntax is as follows:

Code:
window.handleHeight:

window.handle.focus.appearance: (focused handle texture)
!window.handle.focus.backgroundColor: (focused handle color if solid texture)
window.handle.focus.color1: (focused handle starting gradient)
window.handle.focus.color2: (focused handle ending gradient)
window.handle.focus.borderWidth: (focused handle border width measured in pixels)
window.handle.focus.borderColor: (focused handle border color)

window.handle.unfocus.appearance: (unfocused handle texture)
window.handle.unfocus.backgroundColor: (unfocused handle color if solid texture)
window.handle.unfocus.color1: (unfocused handle starting gradient)
window.handle.unfocus.color2: (unfocused handle ending gradient)
window.handle.unfocus.borderWidth: (unfocused handle border width measured in pixels)
window.handle.unfocus.borderColor: (unfocused handle border color)


G. Window example

Code:
window.font: mints-strong
window.alignment: center

window.title.marginWidth: 3

window.title.focus.appearance: raised gradient vertical
!window.title.focus.backgroundColor:
window.title.focus.color1: #ffffff
window.title.focus.color2: #c0c0c0
window.title.focus.borderWidth: 1
window.title.focus.borderColor: #333333

window.title.unfocus.appearance: raised gradient vertical
!window.title.unfocus.backgroundColor:
window.title.unfocus.color1: #c0c0c0
window.title.unfocus.color2: #777777
window.title.unfocus.borderWidth: 1
window.title.unfocus.borderColor: #333333

window.label.marginWidth: 3

window.label.focus.appearance: sunken gradient vertical
!window.label.backgroundColor:
window.label.color1: #c0c0c0
window.label.color2: #ffffff
window.label.borderWidth: 1
window.label.borderColor: #333333
window.label.focus.textColor: #333333

window.label.unfocus.appearance: parentrelative
!window.label.unfocus.backgroundColor:
window.label.unfocus.color1: #c0c0c0
window.label.unfocus.color2: #777777
window.label.unfocus.borderWidth: 1
window.label.unfocus.borderColor: #333333
window.label.unfocus.textColor: #ffffff

window.button.marginWidth: 3

window.button.focus.appearance: raised gradient vertical
!window.button.focus.backgroundColor:
window.button.focus.color1: #c0c0c0
window.button.focus.color2: #777777
window.button.focus.borderWidth: 1
window.button.focus.borderColor: #333333
window.button.focus.foregroundColor: #ffffff

window.button.unfocus.appearance: parentrelative
!window.button.unfocus.backgroundColor:
window.button.unfocus.color1: #c0c0c0
window.button.unfocus.color2: #777777
window.button.unfocus.borderWidth: 1
window.button.unfocus.borderColor: #333333
window.button.unfocus.foregroundColor: #ffffff

window.button.pressed.appearance: sunken gradient vertical
!window.button.pressed.backgroundColor:
window.button.pressed.color1: #c0c0c0
window.button.pressed.color2: #ffffff
window.button.pressed.borderWidth: 1
window.button.pressed.borderColor: #333333
window.button.pressed.foregroundColor: #333333

window.handleHeight: 5

window.handle.focus.appearance: raised gradient vertical
!window.handle.focus.backgroundColor:
window.handle.focus.color1: #ffffff
window.handle.focus.color2: #c0c0c0
window.handle.focus.borderWidth: 1
window.handle.focus.borderColor: #333333

window.handle.unfocus.appearance: raised gradient vertical
!window.handle.unfocus.backgroundColor:
window.handle.unfocus.color1: #c0c0c0
window.handle.unfocus.color2: #777777
window.handle.unfocus.borderWidth: 1
window.handle.unfocus.borderColor: #333333

window.frame.borderWidth: 1
window.frame.focus.borderColor: #c0c0c0
window.frame.unfocus.borderColor: #777777

window.grip.focus.appearance: raised gradient vertical
!window.grip.focus.backgroundColor:
window.grip.focus.color1: #c0c0c0
window.grip.focus.color2: #777777
window.grip.focus.borderWidth: 1
window.grip.focus.borderColor: #333333

window.grip.unfocus.appearance: raised gradient vertical
!window.grip.unfocus.backgroundColor:
window.grip.unfocus.color1: #c0c0c0
window.grip.unfocus.color2: #777777
window.grip.unfocus.borderWidth: 1
window.grip.unfocus.borderColor: #333333


10. Wildcards

Wildcards can be used if you want multiple elements to have the same style as it were. One of the greatly used wildcards used is for font:
Code:
*Font:

You can manipulate the wildcards to be a little more specific if you only want it for lets say, unfocused text color you would do:

Code:
*.unfocus.textColor:


I'll give a small list of wildcards that can be used:

Code:
*.unfocus.appearance:
*.unfocus.foregroundColor:
*.unfocus.color:
*.unfocus.textColor:
*.pressed.appearance:
*.appearance:
*.borderColor:
*.borderWidth:
*.color:
*.colorTo:
*.textColor:
*.foregroundColor:
*.backgroundColor:
*.disabledColor:
*.font:
*.alignment:
*.marginwidth:
*bevelWidth:
*Font:


I personally don't use the wildcards, I would rather have all of the syntax declared for every element but to each his own.

11. Rootcommand

Rootcommand

When styles are loaded rootcommand executes whatever command follows it if declared in the style. Two common uses of rootcommand involve bsetroot or bsetbg.

A. bsetroot

bsetroot is a utility that implements simple backgrounds. Common use of rootcommand with bsetroot is declared as follows:

Code:
rootCommand: bsetroot -gradient vertical -from #ffffff -to #c0c0c0


Some other options for bsetroot are as follows:

-solid color
Sets the root window to specified color.
-mod x y
Creates a modula pattern. You must specify -bg and -fg colors.
-gradient texturestring
Renders the specified texture string to the root window.
Select one of these texture types, they only apply when -gradient is specifed. You must also specify both a -from and a -to color.
texturestring may be one of the following:
horizontal, vertical, diagonal, crossdiagonal, pipecross, elliptic, rectangle and pyramid.
-display display
Tells Bsetroot to connect to the specified display.

-bg, -background color
Background color. Needed for -mod patterns.

-fg, -foreground color
Foreground color. Needed for -mod patterns.

-from color
Start color for rendering textures. Needed for -gradient operation mode.

-to color
ending color for rendering textures. Needed for -gradient operation mode.

-help
version info and short help text.

B. bsetbg

bsetbg is basically to display images as wallpaper.
OPTIONS
-f, -full image
image is stretched to fill the entire desktop.
-t, -tile image
image is tiled on the desktop.
-c, -center image
image is centered on the desktop.
-e, -exec program options fallback-arg image
This option tells bsetbg to run a separate command by executing program with options, where options are arguments to program.
If a fallback-arg is supplied (-full, -tile, or -center as described above), bsetbg will assume that the last argument is a filename. In the case that program exits non-zero or isn't available on the target system, bsetbg will try to handle the file with the fallback argument.
See the examples section for more information on -exec.
-p, -post list
Specifies a list of arguments to pass to the $POST_COMMAND.
-d, -debug
Debugging mode. bsetbg will print commands without executing them.
-g, -generate list
Output a list of default configuration values, suitable for redirecting into ~/.bsetbgrc. Any arguments that are supplied will be considered applications to search for in the system path, overriding bsetbg's internal defaults.
-app imageApp
Use this flag to specify which image application to use. This application may be one of the pre-defined list or any application capable of displaying an image on the root window. This flag may be used in conjunction with passing application specific parameters to the application, in which case they should be enclosed in double quotes.
-v, -version
Output version number.
-h, -help
Output a brief usage message.
12. Style Template

This concludes my tutorial on blackbox styling with the new 0.70 syntax. Here is the full style template that I've created:

Code:
toolbar.appearance: raised gradient vertical
!toolbar.backgroundColor:
toolbar.color1: #ffffff
toolbar.color2: #c0c0c0
toolbar.borderColor: #333333
toolbar.borderWidth: 1
toolbar.alignment: center
toolbar.font: mints-strong
toolbar.marginWidth: 3

toolbar.button.appearance: raised gradient vertical
!toolbar.button.backgroundColor:
toolbar.button.color1: #c0c0c0
toolbar.button.color2: #777777
toolbar.button.borderWidth: 1
toolbar.button.borderColor: #333333
toolbar.button.foregroundColor: #ffffff
toolbar.button.marginWidth: 3

toolbar.button.pressed.appearance: sunken gradient vertical
!toolbar.button.pressed.backgroundColor:
toolbar.button.pressed.color1: #c0c0c0
toolbar.button.pressed.color2: #ffffff
toolbar.button.pressed.borderWidth: 1
toolbar.button.pressed.borderColor: #333333
toolbar.button.pressed.foregroundColor: #333333

toolbar.clock.appearance: parentrelative
!toolbar.clock.backgroundColor:
toolbar.clock.color1: #ffffff
toolbar.clock.color2: #c0c0c0
toolbar.clock.borderWidth: 1
toolbar.clock.borderColor: #333333
toolbar.clock.textColor: #333333
toolbar.clock.marginWidth: 3

toolbar.label.appearance: parentrelative
!toolbar.label.backgroundColor:
toolbar.label.color1: #ffffff
toolbar.label.color2: #c0c0c0
toolbar.label.borderWidth: 1
toolbar.label.borderColor: #333333
toolbar.label.textColor: #333333
toolbar.label.marginWidth: 3

toolbar.windowLabel.appearance: sunken gradient vertical
!toolbar.windowLabel.backgroundColor:
toolbar.windowLabel.color1: #c0c0c0
toolbar.windowLabel.color2: #ffffff
toolbar.windowLabel.borderWidth: 1
toolbar.windowLabel.borderColor: #333333
toolbar.windowLabel.textColor: #333333

menu.title.appearance: raised gradient vertical
!menu.title.backgroundColor:
menu.title.color1: #c0c0c0
menu.title.color2: #777777
menu.title.borderWidth: 1
menu.title.borderColor:   #333333
menu.title.foregroundColor: #ffffff
menu.title.textColor: #ffffff
menu.title.font: mints-strong
menu.title.alignment: center
menu.title.marginWidth: 3

menu.frame.appearance: raised gradient vertical
!menu.frame.backgroundColor:
menu.frame.color1: #ffffff
menu.frame.color2: #c0c0c0
menu.frame.borderWidth: 1
menu.frame.borderColor: #333333
menu.frame.foregroundColor: #333333
menu.frame.textColor: #333333
menu.frame.disabledColor: #eeeeee
menu.frame.font: mints-strong
menu.frame.alignment: left
menu.frame.marginWidth: 3

menu.active: sunken gradient vertical
!menu.active.backgroundColor:
menu.active.color1: #c0c0c0
menu.active.color2: #ffffff
menu.active.borderWidth: 1
menu.active.borderColor: #333333
menu.active.foregroundColor: #333333
menu.active.textColor: #333333

slit.appearance: raised gradient vertical
!slit.backgroundColor:
slit.color1: #ffffff
slit.color2: #c0c0c0
slit.borderWidth: 1
slit.borderColor: #333333
slit.marginWidth: 3

window.font: mints-strong
window.alignment: center

window.title.marginWidth: 3

window.title.focus.appearance: raised gradient vertical
!window.title.focus.backgroundColor:
window.title.focus.color1: #ffffff
window.title.focus.color2: #c0c0c0
window.title.focus.borderWidth: 1
window.title.focus.borderColor: #333333

window.title.unfocus.appearance: raised gradient vertical
!window.title.unfocus.backgroundColor:
window.title.unfocus.color1: #c0c0c0
window.title.unfocus.color2: #777777
window.title.unfocus.borderWidth: 1
window.title.unfocus.borderColor: #333333

window.label.marginWidth: 3

window.label.focus.appearance: sunken gradient vertical
!window.label.backgroundColor:
window.label.color1: #c0c0c0
window.label.color2: #ffffff
window.label.borderWidth: 1
window.label.borderColor: #333333
window.label.focus.textColor: #333333

window.label.unfocus.appearance: parentrelative
!window.label.unfocus.backgroundColor:
window.label.unfocus.color1: #c0c0c0
window.label.unfocus.color2: #777777
window.label.unfocus.borderWidth: 1
window.label.unfocus.borderColor: #333333
window.label.unfocus.textColor: #ffffff

window.button.marginWidth: 3

window.button.focus.appearance: raised gradient vertical
!window.button.focus.backgroundColor:
window.button.focus.color1: #c0c0c0
window.button.focus.color2: #777777
window.button.focus.borderWidth: 1
window.button.focus.borderColor: #333333
window.button.focus.foregroundColor: #ffffff

window.button.unfocus.appearance: parentrelative
!window.button.unfocus.backgroundColor:
window.button.unfocus.color1: #c0c0c0
window.button.unfocus.color2: #777777
window.button.unfocus.borderWidth:   1
window.button.unfocus.borderColor: #333333
window.button.unfocus.foregroundColor: #ffffff

window.button.pressed.appearance: sunken gradient vertical
!window.button.pressed.backgroundColor:
window.button.pressed.color1: #c0c0c0
window.button.pressed.color2: #ffffff
window.button.pressed.borderWidth: 1
window.button.pressed.borderColor: #333333
window.button.pressed.foregroundColor: #333333

window.handleHeight: 5

window.handle.focus.appearance: raised gradient vertical
!window.handle.focus.backgroundColor:
window.handle.focus.color1: #ffffff
window.handle.focus.color2: #c0c0c0
window.handle.focus.borderWidth: 1
window.handle.focus.borderColor: #333333

window.handle.unfocus.appearance: raised gradient vertical
!window.handle.unfocus.backgroundColor:
window.handle.unfocus.color1: #c0c0c0
window.handle.unfocus.color2: #777777
window.handle.unfocus.borderWidth: 1
window.handle.unfocus.borderColor: #333333

window.frame.borderWidth: 1
window.frame.focus.borderColor: #c0c0c0
window.frame.unfocus.borderColor: #777777

window.grip.focus.appearance: raised gradient vertical
!window.grip.focus.backgroundColor:
window.grip.focus.color1: #c0c0c0
window.grip.focus.color2: #777777
window.grip.focus.borderWidth: 1
window.grip.focus.borderColor: #333333

window.grip.unfocus.appearance: raised gradient vertical
!window.grip.unfocus.backgroundColor:
window.grip.unfocus.color1: #c0c0c0
window.grip.unfocus.color2: #777777
window.grip.unfocus.borderWidth: 1
window.grip.unfocus.borderColor: #333333

rootCommand: bsetroot -gradient vertical -from #ffffff -to #c0c0c0


Last edited by snkmchnb on Thu May 03, 2007 1:13 am, edited 4 times in total.



Sun Dec 18, 2005 10:01 pm
Report this post
Profile ICQ YIM WWW
Sponsored Links
Google Adsense


Site Admin

Joined: Sun May 22, 2005 5:39 pm
Posts: 72
Location: San Francisco, CA
Reply with quote
Post 
I think your pressed buttons need an .appearance :) Nice tut!


Mon Dec 19, 2005 3:23 pm
Report this post
Profile ICQ YIM WWW
Site Admin
User avatar

Joined: Tue Jan 25, 2005 1:13 am
Posts: 741
Reply with quote
Post 
Great work, snk - and a much needed one... :)


Mon Dec 19, 2005 3:50 pm
Report this post
Profile
Moderator
User avatar

Joined: Wed Jan 26, 2005 8:04 am
Posts: 2252
Location: Philadelphia, PA
Reply with quote
Post 
Lets not forget:

With rootCommand you can also use it to load commands as well

For example:

Code:
rootCommand: bbkontroller.exe broam('@BroamRelay <path>/<file>')


Path and file is the location of the scripted txt file that BroamRelay will read.

That will give you the option of launching various broams during style change

If you wish to still put a wallpaper and other commands into the bsetroot you can still call this in the BroamRelay txt file.

For example

Code:
@some broam here
@another broam there
@BBCore.exec bsetroot.exe <background settings>


That would typically launch all your broams and then execute your background settings.
This example is made for bblean. I'm not sure what is used to launch programs in Xoblite.

The reason for doing it this way is, say you want to have a Theme based style that loads various elements into your style. This is a good way of doing this.
A sidebar for example. If you want to change the icon pictures you would put the BBInterface picture changes in the Broam relay file and follow that with your bsetroot call to load the rest of your background information.

_________________
if you can not believe it's not butter, then help out with the blackbox Wiki http://wiki.bb4win.org/wiki/Main_Page


Mon Dec 19, 2005 7:14 pm
Report this post
Profile WWW
Site Admin
User avatar

Joined: Sat Dec 11, 2004 10:51 pm
Posts: 102
Location: pittsburgh, pa
Reply with quote
Post 
thanks guys :) i went back and added the ".appearance" to the toolbar.pressed, thanks for catching that NC-17.

as far as the note you made about rootCommand, Nightbreed, i agree that you can do that but i only wanted to go over the main uses of it so it would better fit both *nix/windows at the same time without showing a bias of some sort, but good idea :)

_________________
surely there is a way..


Mon Dec 19, 2005 7:32 pm
Report this post
Profile ICQ YIM WWW
Moderator
User avatar

Joined: Wed Jan 26, 2005 8:04 am
Posts: 2252
Location: Philadelphia, PA
Reply with quote
Post 
I wanted to give some info on styles...

Some interesting things with Wildcards for one that some may not know of.
Wildcards don't always have to be at the end or beginning of the definition.
For example, you can also use:

window.*.borderColor:
or
window.*.unfocus.borderColor: <-- that would effect all the borders on unfocused windows. Without effecting other parts of the style

so if you are creating a style this can help in cutting down alot of typing.

Another thing..
If you have the following lines in a style:

window.frame.focusColor:
window.frame.unfocusColor:

They aren't needed any longer. They don't do anything. So you would use:

window.frame.focus.borderColor:
window.frame.unfocus.borderColor:

Remember, if you are having trouble setting borders to individual window elements check to make sure you have the focus and unfocus defined. Also make sure you have border defined in the initial call of the element.
i.e.,
window.button.pressed: flat gradient elliptic border

if that's not there, it wont get bordered. Again, if you are trying to give all the window elements the same borderColor or borderWidth a simple:

window.*.borderColor:
window.*.borderWidth:

Would define all of those for you. So play around with different possitions of the wildcard, I'm sure you can come up with other time saving places for it :D

Peace...

_________________
if you can not believe it's not butter, then help out with the blackbox Wiki http://wiki.bb4win.org/wiki/Main_Page


Thu Jan 19, 2006 4:09 am
Report this post
Profile WWW
Moderator
User avatar

Joined: Sun Dec 05, 2004 10:08 pm
Posts: 778
Location: LA, US
Reply with quote
Post 
I need to learn this now that I'm running unix blackbox. :(

One thing I can't figure out--I'm using kroeger fonts and they're huge. Is there anything on font size in the new syntax?

_________________
My blackbox styles


Fri Oct 20, 2006 5:20 am
Report this post
Profile WWW
Site Admin
User avatar

Joined: Tue Jan 25, 2005 1:13 am
Posts: 741
Reply with quote
Post 
cthu1hu wrote:
One thing I can't figure out--I'm using kroeger fonts and they're huge. Is there anything on font size in the new syntax?

Same thing that went for the old syntax: fontHeight. And fontWeight, of course, to define normal, bold, etc.


Fri Oct 20, 2006 11:05 am
Report this post
Profile
Moderator
User avatar

Joined: Sun Dec 05, 2004 10:08 pm
Posts: 778
Location: LA, US
Reply with quote
Post 
Thanks pitkon.

I found this:
Code:
kroeger 05_53-7:style=Bold or Verdana-10

_________________
My blackbox styles


Fri Oct 20, 2006 1:12 pm
Report this post
Profile WWW
Site Admin
User avatar

Joined: Tue Jan 25, 2005 1:13 am
Posts: 741
Reply with quote
Post 
Oops, you were talking about unix. Sorry! Yup, this is a rather complicated unix way of defining fonts. I have come across a whole line that goes like this:
verdana -30 *** -b -s**---* or something... lol... Looks more like Nixon transcriptions than an actual style line :D


Fri Oct 20, 2006 1:27 pm
Report this post
Profile
Site Admin
User avatar

Joined: Tue Jan 25, 2005 1:13 am
Posts: 741
Reply with quote
Post 
Here's some examples:

toolbar.font: -microsoft-verdana-bold-r-normal-*-*-120-*-*-p-*-iso8859-2

(from Wonderland style, by FuZZy


toolbar.font: -microsoft-Verdana-medium-r-normal--12-0-0-0-p-0-iso8859-10

(from Air style, by Albertas Agejevas)


Fri Oct 20, 2006 1:40 pm
Report this post
Profile
Moderator
User avatar

Joined: Sat Dec 11, 2004 12:06 am
Posts: 1310
Location: Violent Paradise
Reply with quote
Post 
cthu1hu, if you grab one of the last 2 styles I posted on boxshots.org and look at the style syntax used in them, it's done so I can use them in BBwm since I use the global font overide in bbLean. You could just copy/paste that section then change the font info.

As a general rule, youl'll need to reduce the font size that you use on Windows by a factor of 2 for TTF's eg: Verdana 10 --> Verdana 8, I'm not sure about FON's

_________________
I'll have the roast duck... with mango sauce and a large helping of BB4Win Wiki: http://wiki.bb4win.org/wiki/Main_Page


Fri Oct 20, 2006 4:37 pm
Report this post
Profile
Moderator
User avatar

Joined: Sun Dec 05, 2004 10:08 pm
Posts: 778
Location: LA, US
Reply with quote
Post 
bevel2 isn't supported in blackbox unix?

What are the bevel types?

_________________
My blackbox styles


Fri Oct 20, 2006 10:02 pm
Report this post
Profile WWW
BBDinosaur

Joined: Tue Feb 27, 2007 9:12 am
Posts: 311
Location: Behind The Couch
Reply with quote
Post 
menu.title.marginWidth:
is actually 12px + the number you set in the style file.
just a heads up ;)


Fri May 11, 2007 2:46 am
Report this post
Profile
Sponsored Links
Google Adsense


Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 


Who is online

Users browsing this forum: cwxxeizmt, mirandjl and 2 guests


You cannot post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.