The window decor defines how the windows look. FVWM can set up window decorations by using a color scheme or pixmaps. For the first example lets look at a simple window decor with no pixmaps. For starters define some colorsets to set up the basic colors your window decorations will use. Colorsets can be used to define the colors for all parts of FVWM. The following sets up three simple colorsets.
##### # Window Colorsets ########### Colorset 3 fg #101060, bg #e6e7d7 Colorset 4 fg Black, bg #a6a797 Colorset 5 fg White, bg Black |
This set up three colorsets, numbered 3, 4 and 5, which have both a foreground (fg) and background (bg) color. Colors can be either given in hex format or can be referenced by name using the the X definitions located in /etc/X11/rgb.txt. Other colors you can set with a colorset is the hilight (hi) and shade (sh). Colorsets can be any long integer, but try to keep the numbers as low as possible as fvwm uses memory for each colorset under the one your using. For more info on colorsets read the FvwmThemes man page.
The decor can be broken up into three parts, the TitleStyle, the ButtonStyle and the BorderStyle. The following sets up a simple decor.
##### # Window Decor ########### DestroyDecor MyDecor AddToDecor MyDecor + TitleStyle LeftJustified Height 18 + ButtonStyle 1 ActiveUp Vector 4 30x30@3 60x60@3 60x30@4 30x60@3 -- Flat + ButtonStyle 1 ActiveDown Vector 4 30x30@3 60x60@3 60x30@4 30x60@3 -- Flat + ButtonStyle 1 Inactive Vector 4 30x30@3 60x60@3 60x30@4 30x60@3 -- Flat + ButtonStyle 3 ActiveUp Vector 5 30x60@3 60x60@3 60x50@3 30x50@3 30x60@3 -- Flat + ButtonStyle 3 ActiveDown Vector 5 30x60@3 60x60@3 60x50@3 30x50@3 30x60@3 -- Flat + ButtonStyle 3 Inactive Vector 5 30x60@3 60x60@3 60x50@3 30x50@3 30x60@3 -- Flat + ButtonStyle 5 ActiveUp Vector 7 30x30@3 30x60@3 60x60@3 60x30@3 30x30@3 30x35@3 60x35@3 -- Flat + ButtonStyle 5 ActiveDown Vector 7 30x30@3 30x60@3 60x60@3 60x30@3 30x30@3 30x35@3 60x35@3 -- Flat + ButtonStyle 5 Inactive Vector 7 30x30@3 30x60@3 60x60@3 60x30@3 30x30@3 30x35@3 60x35@3 -- Flat + TitleStyle -- Flat + BorderStyle Simple -- NoInset Flat + ButtonStyle All -- UseTitleStyle |
This decor sets up three buttons, numbers 1, 3 and 5 (the positions is the same as in the window bindings section) using vectors. Note that before a button can be added to a Decor it must first be bound to some action via some binding. Each part is followed by a '-- Flat' to make the buttons and title bar not appear to be pushed out (or in) from the window. Vectors are just simple line drawings. Each vector is set up on a 100x100 grid and can have any number of points all connected by lines. The syntax is 'Vector [number of points] [[point1] [point2] ...]'. The points are defined by 'XxY@Z' where Z is any number 0-4 representing the color to be used for the line. 0 - Shadow(sh), 1 - Hilight(hi), 2 - Background(bg), 3 - Foreground(fg), 4 - Invisible.
Here is an example of a more elaborate Decor using pixmaps for the buttons and title bar.
##### # Ukkosta Decor ########### DestroyDecor UkkostaDecor AddToDecor UkkostaDecor + TitleStyle LeftJustified Height 24 + ButtonStyle 1 \ ActiveUp (Pixmap $[fvwm_img]/button/close-activeup.png -- Flat) \ ActiveDown (Pixmap $[fvwm_img]/button/close-activedown.png -- Flat) \ Inactive (Pixmap $[fvwm_img]/button/inactive.png -- Flat) + ButtonStyle 3 \ ActiveUp (Pixmap $[fvwm_img]/button/iconify-activeup.png -- Flat) \ ActiveDown (Pixmap $[fvwm_img]/button/iconify-activedown.png -- Flat) \ Inactive (Pixmap $[fvwm_img]/button/inactive.png -- Flat) + ButtonStyle 5 \ ActiveUp (Pixmap $[fvwm_img]/button/maximize-activeup.png -- Flat) \ ActiveDown (Pixmap $[fvwm_img]/button/maximize-activedown.png -- Flat) \ Inactive (Pixmap $[fvwm_img]/button/inactive.png -- Flat) + ButtonStyle 1 - Clear + ButtonStyle 3 - Clear MwmDecorMin + ButtonStyle 5 - Clear MwmDecorMax + TitleStyle AllActive MultiPixmap \ Main AdjustedPixmap $[fvwm_img]/decor/title-main-active.xpm, \ LeftEnd AdjustedPixmap $[fvwm_img]/decor/title-leftend-active.xpm, \ RightEnd AdjustedPixmap $[fvwm_img]/decor/title-rightend-active.xpm, \ UnderText AdjustedPixmap $[fvwm_img]/decor/title-undertext-active.xpm, \ LeftOfText AdjustedPixmap $[fvwm_img]/decor/title-leftoftext-active.xpm, \ RightOfext AdjustedPixmap $[fvwm_img]/decor/title-rightoftext-active.xpm + TitleStyle AllInactive MultiPixmap \ Main AdjustedPixmap $[fvwm_img]/decor/title-main-inactive.xpm, \ LeftEnd AdjustedPixmap $[fvwm_img]/decor/title-leftend-inactive.xpm, \ RightEnd AdjustedPixmap $[fvwm_img]/decor/title-rightend-inactive.xpm, \ UnderText AdjustedPixmap $[fvwm_img]/decor/title-undertext-inactive.xpm, \ LeftOfText AdjustedPixmap $[fvwm_img]/decor/title-leftoftext-inactive.xpm, \ RightOfext AdjustedPixmap $[fvwm_img]/decor/title-rightoftext-inactive.xpm + TitleStyle -- Flat + BorderStyle Simple -- NoInset Flat + ButtonStyle All -- UseTitleStyle |
Now that you got the decor defined we need to tell the windows to use it and also tell them what colorset to use. This is done as follows:
##### # Window Styles ########### Style "*" UseDecor MyDecor Style "*" Font "xft:Sans:Bold:size=8:minspace=False:antialias=True" Style "*" BorderWidth 1, HandleWidth 1 Style "*" MWMBorder, FirmBorder Style "*" Colorset 4 Style "*" HilightColorset 3 Style "*" BorderColorset 5 Style "*" HilightBorderColorset 4 |
These string of Styles tell every window to use the Decor MyDecor, along with setting up the font, BorderWidth, (Hilight)Colorset and (Hilight)BorderColorset the windows use. I like all my windows to look the same but one could make different Colorsets and Decors to set up styles for particular applications.
Bindings | index | Menu |