1FvwmTheme(1) Fvwm Modules FvwmTheme(1)
2
3
4
6 FvwmTheme - an fvwm module for managing the appearance of fvwm and its
7 modules
8
9
11 ModuleSynchronous Timeout 5 FvwmTheme
12
13 FvwmTheme can only be invoked by fvwm. Command line invocation of the
14 FvwmTheme module will not work.
15
16
18 FvwmTheme creates appearance resources that may be shared by fvwm and
19 other modules. It reads an initial configuration and also reacts to
20 configuration commands and messages sent from fvwm so that the
21 resources can be dynamically changed.
22
23
25 Starting with 2.5.1, FvwmTheme is obsolete, please read fvwm man page
26 about the built-in colorsets solution. However, all options are still
27 the same, so this man page defines the exact Colorset syntax.
28
29 FvwmTheme must be spawned as a module by fvwm.
30
31 It is highly suggested that FvwmTheme is invoked before any other mod‐
32 ules that use the colorsets provided by FvwmTheme. Thus FvwmTheme has
33 to be invoked with the 'ModuleSynchronous' command by inserting the
34 line 'ModuleSynchronous Timeout 5 FvwmTheme' in the .fvwm2rc file right
35 after the ImagePath has been defined. Invoking FvwmTheme from the
36 InitFunction, StartFunction or RestartFunction or later can cause
37 excessive redrawing of already running modules. It is highly suggested
38 that the configuration lines for FvwmTheme appear in the configuration
39 file before FvwmTheme is started. You can find a proper sample fvwm
40 setup at the end of this document. It is pointless to run more than
41 one FvwmTheme so there is no provision for using an alias name.
42
43
45 FvwmTheme supports some configuration options.
46
47
48 *FvwmTheme: Colorset n options
49 Creates or modifies colorset n. Each colorset has four colors,
50 an optional pixmap and an optional shape mask. The four colors
51 are used by modules as the foreground, background, highlight and
52 shadow colors. When a colorset is created it defaults to a
53 foreground of black and background of gray. The background and
54 foreground are marked as "average" and "contrast" (see later) so
55 that just specifying a pixmap or gradient gives sensible
56 results.
57
58 Warning: The highest colorset number used determines memory con‐
59 sumption. Thus if you define 'Colorset 100000', the memory for
60 100001 colorsets is used. Keep your colorset numbers as small
61 as possible.
62
63 options is a comma separated list containing some of the key‐
64 words: fg, Fore, Foreground, bg, Back, Background, hi, Hilite,
65 Hilight, sh, Shade, Shadow, fgsh, Pixmap, TiledPixmap, Aspect‐
66 Pixmap, Transparent, RootTransparent, Shape, TiledShape, Aspect‐
67 Shape, NoShape, ?Gradient, Tint, fgTint, bgTint, Alpha, fgAlpha,
68 Dither, NoDither, IconTint, IconAlpha, NoShape and Plain.
69
70 fg, Fore and Foreground take a color name as an argument and set
71 the foreground color. The special name Contrast may be used to
72 select a color that contrasts well with the background color.
73 To reset the foreground color to the default value you can sim‐
74 ply omit the color name.
75
76 bg, Back and Background take a color name as an argument and set
77 the background color. It also sets the highlight and shadow
78 colors to values that give a 3d effect unless these have been
79 explicitly set with the options below. The special name Average
80 may be used to select a color that is the average color of the
81 pixmap. If the pixmap is tinted with the Tint option, the tint
82 is not taken in account in the computation of the average color.
83 You should use the bgTint option to get the "real" average
84 color. The background color is reset to the default value if
85 the color name is omitted.
86
87 hi, Hilite and Hilight take a color name as an argument and set
88 the highlight color. If the highlight color is not explicitly
89 set, the default is to calculate it from the background color.
90 To switch back to the default behavior the color name can be
91 omitted.
92
93 sh, Shade and Shadow take a color name as an argument and set
94 the shadow color. If the shadow color is not explicitly set,
95 the default is to calculate it from the background color. To
96 switch back to the default behavior the color name can be omit‐
97 ted.
98
99 fgsh takes a color name as an argument and sets the color used
100 by the shadowing font effect. See the FONT SHADOW EFFECTS sec‐
101 tion of the fvwm man page. By default this color is computed
102 from the foreground and background colors. To switch back to
103 the default the color name can be omitted.
104
105 Pixmap, TiledPixmap and AspectPixmap take a file name as an
106 argument, search the ImagePath and use it as the background
107 pixmap. Any transparent parts are filled with the background
108 color. Not specifying a file name removes any existing one from
109 the colorset. TiledPixmap produces repeated copies of the image
110 with no scaling, Pixmap causes the image to be stretched to fit
111 whatever object the colorset is applied to and AspectPixmap
112 stretches to fit but retains the image aspect ratio.
113
114 Transparent tries to create a transparent background pixmap.
115 The pixmap may be used as a window background to achieve root
116 transparency. For this you should use the ParentalRelativity
117 fvwm style. The root background change may be detected or not,
118 this depends on the program used to set the background. If you
119 use fvwm-root, xsetbg (xli), FvwmBacker with a solid or a col‐
120 orset colors or a recent version of Esetroot (>= 9.2) a back‐
121 ground change should be detected. If background changes are not
122 detected (e.g., if you use xv or xsetroot) you can force detec‐
123 tion by using the -d option of fvwm-root:
124 xv -root -quit mybg.png; fvwm-root -d
125 Due to the way X implements transparency no guarantees can be
126 made that the desired effect can be achieved. The application
127 may even crash. If you experience any problems with this
128 option, do not use it.
129
130 Using outline move and resize (see the OpaqueMoveSize command
131 and the ResizeOpaque style) as well as setting the Window‐
132 ShadeShrinks style may help. The transparency achieved with
133 Transparent depends on whether the colorset is applied to the
134 foreground or the background of a window. In the second case the
135 transparency is relative to the parent window of the window on
136 which the colorset is defined. For example:
137 Colorset 12 VGradient 200 grey30 grey60
138 Colorset 17 Transparent
139 *FvwmIconMan: Colorset 12
140 *FvwmIconMan: PlainColorset 17
141 gives an IconMan with a vertical grey gradient background and
142 the buttons use the background (by transparency). To obtain a
143 (root) transparent IconMan:
144 Colorset 12 Transparent
145 Colorset 17 Transparent
146 Colorset 18 Transparent
147 Colorset 19 Transparent
148 *FvwmIconMan: Colorset 12
149 *FvwmIconMan: PlainColorset 17
150 *FvwmIconMan: FocusColorset 18
151 *FvwmIconMan: IconColorset 19
152 The Colorset IconMan option defines the IconMan window back‐
153 ground, but the PlainColorset and the FocusColorset are drawn on
154 the foreground. So, the transparency of the IconMan buttons is
155 achieved by drawing nothing. Now if this IconMan is swallowed
156 in an FvwmButtons as:
157 FvwmButtons:(Colorset 10, Swallow "FvwmIconMan" 'FvwmIconMan')
158 then, IconMan become a child of FvwmButtons and it is transpar‐
159 ent relative to FvwmButtons. So, in this case IconMan uses Col‐
160 orset 10 as background. If you want root transparency use the
161 RootTransparent option. FvwmButtons, FvwmIconMan, FvwmIdent,
162 FvwmScroll and FvwmTaskBar are relatively simple. There is one
163 main colorset option which defines the background of the window
164 and the other colorsets (if any) are drawn on the foreground.
165 The case of FvwmWinList and FvwmProxy are simpler. With FvwmWin‐
166 List all the colorsets are drawn on the foreground and with
167 FvwmProxy the two colorsets refer to the window backgrounds.
168 FvwmPager is more complicated as almost everything in the pager
169 are windows with some parental relations (the mini windows are
170 the child and the desktops are the parents and all this is com‐
171 plicated by the hilighted page). So, the colorsets apply to the
172 background of these windows. You should experiment. For FvwmForm
173 and FvwmScript the situation is similar. There is a main window
174 (a child of the root window) which corresponds to the main col‐
175 orset and most of the widgets are windows which are children of
176 the main window. Tint may work or not with the Transparent
177 option. When the colorset is drawn on the foreground Tint should
178 work. In the other cases, tinting works in some exceptional
179 cases (and may be very slow). Tinting may work with fvwm menu
180 (without animation). In the other case tinting may work if your
181 X server has backing store enabled (try xdpyinfo to see if this
182 the case). But, there is a chance that the backing store sup‐
183 port of your X server does not work well with the terrible hack
184 used to Tint the ParentRelative Pixmap. So, to get tinted root
185 transparency it is more safe to use the RootTransparent option.
186
187 RootTransparent [ buffer ] creates a root transparent back‐
188 ground. To make this option work, you must use an Esetroot com‐
189 patible program, fvwm-root with the --retain-pixmap option or
190 FvwmBacker with the RetainPixmap option (and colorset or solid
191 backgrounds). The buffer keyword is useful only when the Tint
192 option is used too. This speeds up creation of windows which use
193 the colorset (useful for fvwm menus) at the cost of memory
194 usage. It also speeds up opaque move and resize which can be
195 unacceptably slow without buffer. However, this option may add
196 a lot of memory to your X server (depending on the size of the
197 image used to set the background). In summary, using outline
198 move and resize for modules which use such a colorset may be a
199 good idea.
200
201 Shape, TiledShape and AspectShape take a file name as an argu‐
202 ment, search the ImagePath and use it as the shape bitmap.
203 TiledShape produces repeated copies of the bitmap with no scal‐
204 ing, Shape causes the bitmap to be stretched to fit whatever
205 object the colorset is applied to and AspectShape stretches to
206 fit but retains the bitmap aspect ratio. If the file is a
207 pixmap in xpm format, the shape mask of the pixmap is used.
208
209 Warning: Due to the way X11 implements shapes and the implemen‐
210 tation of the FvwmTheme module you cannot take back making win‐
211 dows shaped. You may have to restart fvwm or the shaped appli‐
212 cation.
213
214 ?Gradient ... creates a pixmap and stretches it to fit the win‐
215 dow. ?Gradient may be one of HGradient, VGradient, DGradient,
216 BGradient, SGradient, CGradient, RGradient or YGradient. The
217 gradient types are as follows: H is horizontal; V is vertical;
218 D is diagonal from top left to bottom right; B is a backwards
219 diagonal from bottom left to top right; S is concentric squares;
220 C is concentric circles; R is a radar like pattern and Y is a
221 Yin Yang style (but without the dots, we are not that mad).
222 Please refer to the COLOR GRADIENTS section in the fvwm man page
223 for the syntax of gradients.
224
225 Tint takes 2 arguments, a color and a percentage between 0 and
226 100. It causes the image defined using ?Pixmap or ?Gradient to
227 be tinted with the specified color using the percentage. If the
228 image is transparent Tint tints only the image part. Unfortu‐
229 nately, a colorset background specified using the Transparent
230 option can give strange results. See the Transparent option for
231 details. With no arguments this option removes the tint.
232
233 fgTint takes 2 arguments, a color and a percentage between 0 and
234 100. It causes the color defined using fg to be tinted with the
235 specified color using the percentage. With no arguments this
236 option removes the tint.
237
238 bgTint takes 2 arguments, a color and a percentage between 0 and
239 100. It causes the color defined using bg to be tinted with the
240 specified color using the percentage. If the sh and hi colors
241 are not specified, they are recomputed from the tinted bg color.
242 With no arguments this option removes the tint.
243
244 Alpha takes a percentage between 0 and 100 as an argument. It
245 causes fvwm to merge the image defined using ?Pixmap or ?Gradi‐
246 ent with the bg color using the percentage. If the percentage is
247 0 the image is hidden and if it is 100 the image is displayed as
248 usual (no merge). The default is 100 and it is restored if no
249 argument is given.
250
251 fgAlpha takes a percentage between 0 and 100 as an argument. It
252 causes fvwm to merge the text and the colorset background using
253 the percentage. If the percentage is 0 the text is hidden and if
254 it is 100 the text is displayed as usual (no merge). This
255 option has an effect only with fonts loaded by Xft, see the FONT
256 NAMES AND FONT LOADING section of fvwm man page. The default is
257 100 and it is restored if no argument is given.
258
259 Dither causes fvwm to dither the image defined using ?Pixmap or
260 ?Gradient. This is useful only with displays with depth less
261 than or equal to 16 (i.e., on displays which can only display
262 less than 65537 colors at once). The dithering effect lets you
263 simulate having more colors available that you actually have.
264 NoDither causes fvwm to do not dither the images. Dither is the
265 default if the depth is less than or equal to 8 (a screen with
266 256 colors or less). In depth 15 (32768 colors) and 16 (65536
267 colors), the default is NoDither, however this effect can be
268 useful with images which contain a lot of close colors. For
269 example a fine gradient will look more smooth.
270
271 IconTint takes 2 arguments, a color and a percentage between 0
272 and 100. It causes fvwm or a module to tint the "icons" which
273 are rendered into the colorset background with the specified
274 color using a percentage. Here "icons" means, fvwm Icons, fvwm
275 menu icons, MiniIcons which represent applications in various
276 modules, images loaded by modules (e.g., images specified by the
277 Icon FvwmButtons button option) ...etc. With no arguments this
278 option removes the icon tint.
279
280 IconAlpha takes a percentage between 0 and 100 as an argument.
281 It causes fvwm to merge the "icons" which are rendered into the
282 colorset background using this percentage. The default is 100
283 and it is restored if no argument is given.
284
285 Note: It is equivalent to use "Tint a_color rate" and "Alpha a"
286 if a = 100 and the bg color is a_color. This equivalence does
287 not hold for IconAlpha and IconTint as the background can be an
288 image or a gradient (and not a uniform color background). How‐
289 ever, in some cases you can achieve (almost) the same effect by
290 using IconTint in the place of IconAlpha. This is preferable as,
291 in general, IconAlpha generates more redrawing than IconTint.
292
293 NoShape removes the shape mask from the colorset while Plain
294 removes the background pixmap or gradient.
295
296
298 The following fvwm command may be executed at any time to alter the
299 colorsets. It may be bound to a menu item or typed into a module such
300 as FvwmConsole.
301
302
303 SendToModule FvwmTheme Colorset options
304 The syntax is the same as the configuration option.
305
306
308 *FvwmTheme: Colorset 3 fg wheat, bg navy
309
310 If necessary this creates colorsets 0, 1, 2 and 3 and then changes col‐
311 orset 3 to have a foreground of wheat, a background of navy.
312
313 *FvwmTheme: Colorset 3 bg "navy blue"
314
315 changes the background color of colorset 3 to navy blue. The foreground
316 and pixmap are unchanged.
317
318 *FvwmTheme: Colorset 3 AspectPixmap large_murky_dungeon.xpm
319
320 Causes depression.
321
322 *FvwmTheme: Colorset 3 bg Average
323
324 Sets the background color and the relief colors to match the background
325 pixmap. This is the default setting but it must be used if a background
326 color was specified and is now not required.
327
328 *FvwmTheme: Colorset 3 YGradient 200 3 \
329 blue 1000 navy 1 blue 1000 navy
330
331 Adds a Yin Yang gradient background pixmap to colorset 3. If the back‐
332 ground is set to average it is recomputed along with the foreground if
333 that is set to contrast.
334
335 #!/bin/sh
336 FvwmCommand "SendToModule FvwmTheme Colorset 7 fg navy, bg gray"
337 while true
338 do
339 FvwmCommand "SendToModule FvwmTheme Colorset 7 fg gray"
340 sleep 1
341 FvwmCommand "SendToModule FvwmTheme Colorset 7 fg navy"
342 sleep 1
343 done
344
345 Makes colorset 7 blink.
346
347 The color names used in colorsets can be substituted in any fvwm com‐
348 mand. Please refer to the COMMAND EXPANSION section in the fvwm man
349 page and the example below for a description.
350
351
353 Below you can find a fvwm configuration file that demonstrates the use
354 of the FvwmTheme module. The order in which FvwmTheme and the other
355 modules are configured and started is important.
356
357 # where your images are
358 ImagePath <put your image path here>
359
360 #
361 # FvwmTheme
362 #
363 # The FvwmTheme setup must be first in the config file,
364 # right after the paths are set.
365 #
366 # Instead of the *FvwmTheme: Colorset... lines below you
367 # could read in a file with these commands. So to change
368 # your color scheme you can simply copy a different file
369 # over your palette file and restart fvwm:
370 #
371 # Read /home/my_user_name/.fvwm/.fvwm_palette
372 #
373
374 # 0 = Default colors
375 # 1 = Inactive windows
376 # 2 = Active windows
377 # 3 = Inactive menu entry and menu background
378 # 4 = Active menu entry
379 # 5 = greyed out menu entry (only bg used)
380 # 6 = module foreground and background
381 # 7 = hilight colors
382 *FvwmTheme: Colorset 0 fg black, bg rgb:b4/aa/94
383 *FvwmTheme: Colorset 1 fg black, bg rgb:a1/b2/c8
384 *FvwmTheme: Colorset 2 fg black, bg rgb:da/9a/68
385 *FvwmTheme: Colorset 3 fg black, bg rgb:b4/aa/94, \
386 VGradient 100 dtcolor5 rgb:b4/aa/94
387 *FvwmTheme: Colorset 4 fg black, bg rgb:b4/aa/94
388 *FvwmTheme: Colorset 5 fg rgb:d2/bf/a8, \
389 bg rgb:b4/aa/94
390 *FvwmTheme: Colorset 6 fg black, bg rgb:b4/aa/94, \
391 VGradient 100 dtcolor5 rgb:b4/aa/94
392 *FvwmTheme: Colorset 7 fg black, bg rgb:94/ab/bf
393
394 # run FvwmTheme before anything else is done
395 ModuleSynchronous Timeout 5 FvwmTheme
396
397 #
398 # general setup
399 #
400 Style * Colorset 1
401 Style * HilightColorset 2
402 MenuStyle * MenuColorset 3
403 MenuStyle * ActiveColorset 4
404 MenuStyle * GreyedColorset 5
405
406 #
407 # Applications
408 #
409 AddToFunc InitFunction
410 + I Exec exec xterm -fg $[fg.cs0] -bg $[bg.cs0]
411
412 #
413 # module setup
414 #
415
416 # ... more FvwmPager config lines ...
417 *FvwmPager: Colorset * 6
418 *FvwmPager: BalloonColorset * 6
419 *FvwmPager: HilightColorset * 7
420 *FvwmPager: WindowColorsets 1 2
421
422 # ... more FvwmIconMan config lines ...
423 *FvwmIconMan: Colorset 6
424 *FvwmIconMan: FocusColorset 2
425 *FvwmIconMan: FocusAndSelectColorset 2
426 *FvwmIconMan: PlainColorset 6
427 *FvwmIconMan: SelectColorset 6
428 *FvwmIconMan: TitleColorset 6
429
430 # ... more FvwmButtons config lines ...
431 *FvwmButtons: Colorset 6
432 # sample button passing color to xterm
433 *FvwmButtons: (Title xterm, \
434 Action "Exec exec xterm -fg $[fg.cs6] -bg[bg.cs6]")
435
436 # ... more FvwmWharf config lines ...
437 *FvwmWharf: Colorset 6
438
439 # ... more FvwmIdent config lines ...
440 *FvwmIdent: Colorset 6
441
442 # ... more FvwmWinList config lines ...
443 *FvwmWinList: Colorset 1
444 *FvwmWinList: FocusColorset 2
445 *FvwmWinList: IconColorset 1
446
447 # ... more FvwmTaskBar config lines ...
448 *FvwmTaskBar: Colorset 6
449 *FvwmTaskBar: IconColorset 6
450 *FvwmTaskBar: TipsColorset 0
451
452 If you need to have more colors and don't want to reinvent the wheel,
453 you may use the convention used in fvwm-themes, it defines the meaning
454 of the first 40 colorsets for nearly all purposes:
455
456 http://fvwm-themes.sourceforge.net/doc/colorsets
457
458
460 Initialization of fvwm, FvwmTheme and the other modules is tricky.
461 Please pay close attention to the text in the INVOCATION section. The
462 example above demonstrates the proper way to get a FvwmTheme setup run‐
463 ning.
464
465
467 Prefers to remain anonymous. With help from Brad Giaccio and Dominik
468 Vogt.
469
470
472 Copyright (C) 1999 Joey Shutup. No guarantees or warranties or any‐
473 thing are provided or implied in any way whatsoever. Use this program
474 at your own risk. Permission to use this program for any purpose is
475 given, as long as the copyright is kept intact.
476
477
478
4793rd Berkeley Distribution 09 May 2010 (2.5.30) FvwmTheme(1)