this still is a "buggy" version of the styleHowTo. i know it is full of mistakes of any kind. if you find any of them please do me and all other users the favour and contact me either via email: tenner(at)fluxbox(dot)org or meet me (tenner) in #fluxbox or #fluxmod on irc.freenode.net to give me a hint of what i did wrong. if anyone wants to tell me what is not clearly explained, please let me know the same way, i'm gonna say thank you, that's for sure ;)
i bow to all people who helped me deleting mistakes and told me additional information. extra thanks to lmg aka M.G. Kishalmi, who reported a bunch of mistakes and had great ideas for additional informations and hints.
some rules to know (please read this first, maybe your problem is solved after that)
this are some basics you should follow:
name_of_the_style/ | |____ theme.cfg | |____ preview.jpg (additional) | |____ pixmaps/ | |____ * (all image files)
the main parts
this are the main components a fluxbox style consists of:
most people ask about the font-handling, so i will start with it first.
one useful thing to know is that you can include fontsettings. that does mean you can put your whole *.font settings in a seperate file and and point to it in the style file. imagine you have some fonts you prefer and don't want to change every style you have downloaded. then you can simply make a file e.g. "~/.fluxbox/myfonts" and write the normal fonts-stuff (as you would write it in the style-file) in this local file. then put the following line in the style:
# include "~/.fluxbox/myfonts"
don't forget the "#". due to fluxbox will use the last entry in a style file, if something is double, just make sure it's the last one (echo "foo" >> ~/.fluxbox/styles/bar/theme.cfg). that lets you always use your local style-fonts. this has nothing to do with the making of a style but it's good to know :)
.but back to the fonts in a style ..
.. there are seven elements you can define a font for:
menu-title (the title of all menus you use)
frame (the entries that are in every menu)
window (the font of the title of every window)
clock (yeah, it's the fluxbox clock)
workspace (the font of the workspace labels aka name)
iconbar (the label of the application the iconbar is holding)
(as you can see, different from the window, you can set fonts for two iconbar-states namely focused/unfocused)
if using xft-fonts (so called ttf-fonts) you use them like this: "<fontname>-size". you can set them bold by adding ":bold". this gets easier with an example. the next line will give you the tahoma font in bold, with a size of 12.
if using x-fonts please run 'xfontsel' to find out what the right names are. for example:
furthermore you can make fluxbox try to load several fonts
that will cause fluxbox to load (if compiled with xft) arial-10, otherwise, if the loading failes, it will load a different xft-font. while a fluxbox not compiled with xft support will try to load the artwiz-font. if everything fails all will fall back to "fixed". so in the end it will always load a font even though it is not the one you have set in the style.
if using xft-fonts you can set up two nifty effects on the fonts.
you can set one effect either a shadow or a halo. if set once there is no need to set a color for those items, but you can. look at the example below to get an impression of what i mean:
as you can see the title (meaTbox) has a black shadow with a horizontal offset of 2 and a vertical offset of 5. the values can be negativ too. positive values will be right for x, down for y. negative values will be the opposite (left and up).
the way to style the parts of fluxbox is basicly always the same. every part consists of similar components (sometimes the same components) that will repeat within the other parts. that sounds very weired and if you know a better sentence to explain it please let me know, but let me make this clear with an example:
the menu can have a border and a bevel. this border around the menu can have a color and a width. the window can have the same items as the menu. it can have a border, a border-color, the border around the window can have an own width and color and so forth.
this was only to show that the way to make a style is almost the same for all components of fluxbox. this situation gives you a simple way to "style all in one", but more of that later in the next chapter (generalizing (wildcards)). let's start with a "classic style".
to give you an overview of all options avaliable we start with the menu
if you can't remember what the texture options are or don't even know what they look like, check the texture-examples page.
the explanation is really easy.
*.width sets the width in pixel for the border and the bevel.
*.borderColor does what it says.
menu.bullet defines the bullet (little thing in the root-menu that indicates a submenu). the bullet addapts the color of the frame-text that is set with menu.frame.textColor and the hilite-color from menu.hilite.textColor. i won't say anything about menu.bullet.position. the bullet-types are self-explanary, don't tell me anything else.
menu.frame.disableColor is the color of the menuselections of the layer-menu, the placement-menu, the iconbar-mode-menu and such.
the selection indicator gets its normal color AND the texture from the menu.hilite settings. the color AND texture in hilited state is the same as of the menu.frame settings.
menu.itemHeight sets the padding of each line in the menu, so you can increase the height of each line of the menu. that will put more space between the entries if the font is too small. this has NO effect on the title! just try it out if you think the menu looks too wedged and keep in mind that you cannot make it smaller than the height needed to display the font correctly. you have to try different values or even change to a smaller font. there are no general settings for that. but be aware of this: if you have icons in your menu, then you will stretch them too.
menu.titleHeight is the same as above but it only affects the menutitle. again: you can't make the height smaller than the minimal space that is needed to display the font properly.
the rest are usual options for each item (texture, justify, color, colorTo, textColor).
*.title|frame|hilite: <texture> for examples of what textures are, you can go to the texture-examples page.
*.justify: <left|center|right> this is the allignment of the text.
*.color: <color> this is the background color of the item (title, frame ..).
*.colorTo: <color> this is the second color for a gradient texture. if you have a texture such as "flat" or "sunken". only need the "*.color: ..". something like "flat gradient horizontal" will use the second color to render the texture. see the texture-examples page again.
the next item is the toolbar
i won't explain the texturizing again its the same as for the menu. i'll just explain the new items.
toolbar.systray colorizing, texturizing and the use of images does not have any influence on the background of gnome-app backgrounds. icons from applications such as gaim or xchat (all based on gtk2) get their background from the actual gnome/gtk theme. only icons of kde-apps (qt) such as klipper or k3b manage to use the toolbar.systray background.
toolbar.height sets the height of the toolbar, BUT only if the value for session.screen*.toolbar.height is set to '0' in the used init file (~/.fluxbox/init in most cases). this prevents the takeover of user settings by the style. you should know that.
toolbar, toolbar.color and toolbar.colorTo are only used if toolbar.bevelWidth is >0. you have the opportunity to colorize the toolbar-bevel with this settings. look at the picture on the texture-examples page, it is the same as the title for the titlebar and remember: if the bevel is 0, the toolbar settings are not visible.
toolbar.button.picColor sets the color of the arrow inside the toolbar-buttons
toolbar.button.color sets the background color for all buttons in the toolbar.
toolbar.button.colorTo sets the second background color for gradients
toolbar.button.pressed.* this is the same as above, only that you can set different colors for the pressed state of the buttons.
toolbar.iconbar.empty.* this is how the iconbar will look like, if no window is open.
toolbar.iconbar.focused.* a window in the iconbar that is focused
toolbar.iconbar.unfocused.* window in the iconbar that is unfocused
and least but not last the windowdecorations
again only the new items. to get a clue of what the components of the window are look at my screenshot and check out the picture at the top of the texture-examples page.
window.title.height: <int> sets the titlebar's height.
window.justify sets the alignment of the text that appears in the titlebar.
window.label.focus.* is for the focused window, window.label.unfocus.* is for all other windows. pretty obvious i think.
the window.title.* is only used if window.bevelWidth is >0. look at the picture on the texture-examples page. if the bevel is 0, the title settings are not visible.
window.handleWidth is a confusing expression. it doesn't set the width of the handle, it sets the height of the handle/grip.
fluxbox offers some sort of eye-candy if you want to call it like that. you can make the corners of the toolbar/window/menu round. (this for sure works for classic styles as well as for pixmap stlyes)
menu.roundCorners: TopRight TopLeft BottomRight BottomLeft
window.roundCorners: TopRight TopLeft BottomRight BottomLeft
you can set all corners round or just one or two or three and you can combine them as you like. (e.g. only 'TopLeft BottomRight')
another thing to know is that e.g. borderless applications with window.roundCorners set, stay round, if you've ever asked yourself how to get this round borderless terms.
the toolbar can only have round corners on the upper side, so toolbar.shaped (true OR false) is all you have to set.
maybe you have recognized that all components have the same elements such as "border", "borderColor". that will lead to an interesting part of fluxbox styling.
let's say you want to have the same font for all components. as discribed in fonts you will have to define the fonts for every single part.
but there's a quicker way fluxbox can handle that. instead of writing:
you can simply write:
the same wildcard can be used if e.g. you want the entire toolbar to have the same font. simply wite:
just try it out, this way makes it even easier to style fluxbox.
btw, due to the asterisk (*) works as a wildcard for the dot (.) you could also write *font: sans-8, but don't try to use this in the middle of an expression. better use the way above to avoid mistakes.
as for classic styles toolbar.systray colorizing, texturizing and the use of images does not have any influence on the background of gnome-app backgrounds. icons from applications such as gaim or xchat (all based on gtk2) get their background from the actual gnome/gtk theme. only icons of kde-apps (qt) such as klipper or k3b manage to use the toolbar.systray background.
doing pixmap styles (or any other supported image format) is quite the same as writing a classic style. the only signifficant global change is that the classic texturizing is replaced with an image. to add an important thing:
whenever a valid image is set in the style, the "classic" colors/textures will be overwritten for the respective part of the style. just look at the examples below to understand what i mean. this is the clock from the toolbar:
replacing the texture relevant parts and replace them with pixmaps means:
toolbar.clock.pixmap: <image file>
as you can see the things that have changed are:
toolbar.clock: <texture>, toolbar.clock.color: <color> and toolbar.clock.colorTo: <color> are gone.
the line toolbar.clock.pixmap: <image file> was added. the three exchanged lines from above can be erased or you can leave them in the style, it doesn't matter they have no use in this case. actually it is logical, because the components's background is no longer rendered. so there's no need for texture options or gradient colors at all.
images for menu.title.pixmap, toolbar.pixmap, toolbar.clock.pixmap, toolbar.workspace.pixmap, toolbar.iconbar.empty.pixmap, toolbar.iconbar.focused.pixmap, toolbar.iconbar.unfocused.pixmap, window.title.focus.pixmap, window.label.focus.pixmap, window.handle.focus.pixmap, window.handle.unfocus.pixmap, window.grip.focus.pixmap and window.grip.unfocus.pixmap appear as high as defined by the corresponding *.height value. those images will be stretched horizontally to the length of the part.
the image size for a button should be a 1:1 ratio with the the height/width = *.height since the image is stretched horizontally and vertically if you define *.height bigger than the button-image is. this sounds confusing the way i explain it, but if you try it should get clear. you may play around with different image sizes but believe me, it's just a pain in the ass usually.
furthermore another important thing is: in a classic style all buttons are defined through window.button.*. in a pixmap style you CAN make a image for each button and their states (focused, unfocused, pressed). you don't have to but you can. to give an example of the buttons you can style look at this:
the syntax differs a little bit from the other parts, but again it's really simple to understand. look at the little screenshot to get a clue what the buttons are.
window.*.pixmap are the pixmaps you see on a focused window.
window.*.unfocus.pixmap are the pixmaps you see on an unfocused window.
window.*.pressed.pixmap are the images you see when you click the button.
window.stuck.* is the activated state of the stick buttton.
some other things are different from classic styles. the bullet and the selection indicator (the little thing to show what configuration options are enabled or what style is selected) can be images. furthermore those elements can have different states:
menu.submenu.pixmap: <image file>
menu.hilite.submenu.pixmap: <image file>
menu.selected.pixmap: <image file>
menu.hilite.selected.pixmap: <image file>
menu.unselected.pixmap: <image file>
menu.hilite.unselected.pixmap: <image file>
menu.selected.pixmap and menu.unselected.pixmap are selfexplanary i think (they are the selection indicators). the menu.submenu.pixmap entry simply is the well known bullet.
a size of 16x16 for the bullets and selection images seem to be most appropriate. it depents on the fontsize and the menu's bevel how much they will be streched.
the *.hilite.* calls the images that show up when the mouse comes over the line of the menu. you don't have to set them. if nothing is defined, fluxbox will use the images that are shown when not highlighted.
last update 03/08/2006