fvwm 颜色集 和 环境变量

来源:互联网 发布:华为机顶盒修改mac 编辑:程序博客网 时间:2024/05/21 07:15
Colorset

Colorset num [options]


创建和修改颜色集合的数字,将来用这个数据来区分颜色。


By convention, colorsets are numbered like this:


# 0 = Default colors
# 1 = Inactive windows
# 2 = Active windows
# 3 = Inactive menu entry and menu background
# 4 = Active menu entry
# 5 = greyed out menu entry (only bg used)
# 6 = module foreground and background

# 7 = hilight colors


在fvwm-themes中已经定义了40中颜色。可以先用这些基本够使用了。

每个颜色集合有4个颜色: foreground, background, highlight and shadow ,前景,背景,高亮,阴影。

默认颜色: foreground of black and background of gray.  

用渐变的色中可以分别指定这四个颜色。


options is a comma separated list containing some of the keywords: fg, Fore, Foreground, bg, Back, Background, hi, Hilite, Hilight, sh, Shade, Shadow, fgsh, Pixmap, TiledPixmap, AspectPixmap, Transparent, RootTransparent, Shape, TiledShape, AspectShape, NoShape, ?Gradient, Tint, fgTint, bgTint, Alpha, fgAlpha, Dither, NoDither, IconTint, IconAlpha, Plain.


fg, Fore and Foreground take a color name as an argument and set the foreground color. The special name Contrast may be used to select a color that contrasts well with the background color. To reset the foreground color to the default value you can simply omit the color name.


bg, Back and Background take a color name as an argument and set the background color. It also sets the highlight and shadow colors to values that give a 3d effect unless these have been explicitly set with the options below. The special name Average may be used to select a color that is the average color of the pixmap. If the pixmap is tinted with the Tint option, the tint is not taken in account in the computation of the average color. You should use the bgTint option to get the "real" average color. The background color is reset to the default value if the color name is omitted.


hi, Hilite and Hilight take a color name as an argument and set the highlight color. If the highlight color is not explicitly set, the default is to calculate it from the background color. To switch back to the default behavior the color name can be omitted.


sh, Shade and Shadow take a color name as an argument and set the shadow color. If the shadow color is not explicitly set, the default is to calculate it from the background color. To switch back to the default behavior the color name can be omitted.


fgsh takes a color name as an argument and sets the color used by the shadowing font effect. See the Font Shadow Effects section of the fvwm man page. By default this color is computed from the foreground and background colors. To switch back to the default the color name can be omitted.


Pixmap, TiledPixmap and AspectPixmap take a file name as an argument, search the ImagePath and use it as the background pixmap. Any transparent parts are filled with the background color. Not specifying a file name removes any existing image from the colorset. TiledPixmap produces repeated copies of the image with no scaling, Pixmap causes the image to be stretched to fit whatever object the colorset is applied to and AspectPixmap stretches to fit but retains the image aspect ratio.


Transparent creates a transparent background pixmap. The pixmap is used as a window background to achieve root transparency. For this you should use the ParentalRelativity option to the Style command. A subsequent root background change may be detected or not, this depends on the program used to set the background. If you use fvwm-root, xsetbg (xli), FvwmBacker with solid or colorset colors or a recent version of Esetroot (>= 9.2) a background change is detected. If background changes are not detected (e.g., if you use xv or xsetroot) you can force detection by using the -d option of fvwm-root:


xv -root -quit mybg.png; fvwm-root -d
Due to the way X implements transparency no guarantees can be made that the desired effect can be achieved. The application may even crash. If you experience any problems with this option, do not use it.


Using outline move and resize (see the OpaqueMoveSize command and the ResizeOpaque Style option) as well as setting the WindowShadeShrinks style may help. The transparency achieved with Transparent depends on whether the colorset is applied to the foreground or the background of a window. In the second case the transparency is relative to the parent window of the window on which the colorset is defined. For example:


Colorset 12 VGradient 200 grey30 grey60
Colorset 17 Transparent
*FvwmIconMan: Colorset 12
*FvwmIconMan: PlainColorset 17
gives an IconMan with a vertical grey gradient background and the buttons use the background (by transparency). To obtain a (root) transparent IconMan:


Colorset 12 Transparent
Colorset 17 Transparent
Colorset 18 Transparent
Colorset 19 Transparent


*FvwmIconMan: Colorset 12
*FvwmIconMan: PlainColorset 17
*FvwmIconMan: FocusColorset 18
*FvwmIconMan: IconColorset  19
The Colorset IconMan option defines the IconMan window background, but the PlainColorset and the FocusColorset are drawn on the foreground. So, the transparency of the IconMan buttons is achieved by drawing nothing. Now if this IconMan is swallowed in an FvwmButtons as:


FvwmButtons:(Colorset 10, Swallow "FvwmIconMan" 'FvwmIconMan')
then, FvwmIconMan becomes a child of FvwmButtons and it is transparent relative to FvwmButtons. So, in this case FvwmIconMan uses Colorset 10 as background. If you want root transparency use the RootTransparent option. FvwmButtons, FvwmIconMan, FvwmIdent, FvwmScroll and FvwmTaskBar are relatively simple. There is one main colorset option which defines the background of the window and the other colorsets (if any) are drawn on the foreground. The case of FvwmWinList and FvwmProxy are simpler. With FvwmWinList all the colorsets are drawn on the foreground and with FvwmProxy the two colorsets refer to the window backgrounds. FvwmPager is more complicated as almost everything in the pager are windows with some parental relations (the mini windows are the child and the desktops are the parents and all this is complicated by the hilighted page). So, the colorsets apply to the background of these windows. You should experiment. For FvwmForm and FvwmScript the situation is similar. There is a main window (a child of the root window) which corresponds to the main colorset and most of the widgets are windows which are children of the main window. Tint may work or not with the Transparent option. When the colorset is drawn on the foreground Tint should work. In some cases, tinting may be very slow. Tinting may work with fvwm menu (without animation). Tinting may work better if your X server has backing store enabled (try xdpyinfo to see if this the case). There is a chance that the backing store support of your X server does not work well with the terrible hack used to Tint the ParentRelative Pixmap. So, to get tinted root transparency it is more safe to use the RootTransparent option.


RootTransparent [ buffer ] creates a root transparent background. To make this option work, you must use an Esetroot compatible program, fvwm-root with the --retain-pixmap option or FvwmBacker with the RetainPixmap option (and colorset or solid backgrounds). The buffer keyword is useful only when the Tint option is used too. This speeds up creation of windows which use the colorset (useful for fvwm menus) at the cost of memory usage. It also speeds up opaque move and resize which can be unacceptably slow without buffer. However, this option may add a lot of memory to your X server (depending on the size of the image used to set the background). In summary, using outline move and resize for modules which use such a colorset may be a good idea.


Shape, TiledShape and AspectShape take a file name as an argument, search the ImagePath and use it as the shape bitmap. TiledShape produces repeated copies of the bitmap with no scaling, Shape causes the bitmap to be stretched to fit whatever object the colorset is applied to and AspectShape stretches to fit but retains the bitmap aspect ratio. If the file is a pixmap in xpm format the shape mask (all opaque pixels) of the pixmap is used. For png and svg images, the shape mask is equivalent to all not completely transparent pixels (alpha > 0).


Warning


Due to the way X11 implements shapes you cannot take back making windows shaped. You may have to restart fvwm or the shaped application.
?Gradient ... creates a pixmap and stretches it to fit the window. ?Gradient may be one of HGradient, VGradient, DGradient, BGradient, SGradient, CGradient, RGradient or YGradient. The gradient types are as follows: H is horizontal; V is vertical; D is diagonal from top left to bottom right; B is a backwards diagonal from bottom left to top right; S is concentric squares; C is concentric circles; R is a radar like pattern and Y is a Yin Yang style (but without the dots). Please refer to the Color Gradients section for the syntax of gradients.


Tint takes 2 arguments, a color and a percentage between 0 and 100. It causes the image defined using ?Pixmap or ?Gradient to be tinted with the specified color using the percentage. If the image is transparent Tint tints only the image part. Unfortunately, a colorset background specified using the Transparent option can give strange results. See the Transparent option for details. With no arguments this option removes the tint.


fgTint takes 2 arguments, a color and a percentage between 0 and 100. It causes the color defined using fg to be tinted with the specified color using the percentage. With no arguments this option removes the tint.


bgTint takes 2 arguments, a color and a percentage between 0 and 100. It causes the color defined using bg to be tinted with the specified color using the percentage. If the sh and hi colors are not specified, they are recomputed from the tinted bg color. With no arguments this option removes the tint.


Alpha takes a percentage between 0 and 100 as an argument. It causes fvwm to merge the image defined using ?Pixmap or ?Gradient with the bg color using the percentage. If the percentage is 0 the image is hidden and if it is 100 the image is displayed as usual (no merge). The default is 100 and it is restored if no argument is given.


fgAlpha takes a percentage between 0 and 100 as an argument. It causes fvwm to merge the text and the colorset background using the percentage. If the percentage is 0 the text is hidden and if it is 100 the text is displayed as usual (no merge). This option has an effect only with fonts loaded by Xft, see the Font Names and Font Loading section. The default is 100 and it is restored if no argument is given.


Dither causes fvwm to dither the image defined using ?Pixmap or ?Gradient. This is useful only with displays with depth less than or equal to 16 (i.e., on displays which can only display less than 65537 colors at once). The dithering effect lets you simulate having more colors available that you actually have. NoDither causes fvwm to do not dither the images. Dither is the default if the depth is less than or equal to 8 (a screen with 256 colors or less). In depth 15 (32768 colors) and 16 (65536 colors), the default is NoDither, however this effect can be useful with images which contain a lot of close colors. For example a fine gradient looks more smooth.


IconTint takes 2 arguments, a color and a percentage between 0 and 100. It causes fvwm or a module to tint the "icons" which are rendered into the colorset background with the specified color using a percentage. Here "icons" means, fvwm Icons, fvwm menu icons, MiniIcons which represent applications in various modules, images loaded by modules (e.g., images specified by the Icon FvwmButtons button option) ...etc. With no arguments this option removes the icon tint.


IconAlpha takes a percentage between 0 and 100 as an argument. It causes fvwm to merge the "icons" which are rendered into the colorset background using this percentage. The default is 100 and it is restored if no argument is given.


Note: It is equivalent to use "Tint a_color rate" and "Alpha a" if a = 100 and the bg color is a_color. This equivalence does not hold for IconAlpha and IconTint as the background can be an image or a gradient (and not a uniform color background). However, in some cases you can achieve (almost) the same effect by using IconTint in the place of IconAlpha. This is preferable as, in general, IconAlpha generates more redrawing than IconTint.


NoShape removes the shape mask from the colorset while Plain removes the background pixmap or gradient.


Examples


Colorset 3 fg tan, bg navy
If necessary this creates colorsets 0, 1, 2 and 3 and then changes colorset 3 to have a foreground of tan, a background of navy.


Colorset 3 bg "navy blue"
changes the background color of colorset 3 to navy blue. The foreground and pixmap are unchanged.


Colorset 3 AspectPixmap large_murky_dungeon.xpm
causes depression.


Colorset 3 bg Average
Sets the background color and the relief colors to match the background pixmap. This is the default setting but it must be used if a background color was specified and is now not required.


Colorset 3 YGradient 200 3 blue 1000 navy 1 blue 1000 navy
Adds a Yin Yang gradient background pixmap to colorset 3. If the background is set to average it is recomputed along with the foreground if that is set to contrast.


#!/bin/sh
FvwmCommand "Colorset 7 fg navy, bg gray"
while true
do
  FvwmCommand "Colorset 7 fg gray"
  sleep 1
  FvwmCommand "Colorset 7 fg navy"
  sleep 1
done
Makes colorset 7 blink.


The color names used in colorsets are saved as fvwm variables which can be substituted in any fvwm command. For example:


AddToFunc InitFunction
+ I Exec exec xterm -fg $[fg.cs0] -bg $[bg.cs0]
Where $[fg.cs0] is the foreground color of colorset zero. Please refer to the Command Expansion section for more information.


31.14.2. CleanupColorsets


CleanupColorsets


Resets a definition of all colorsets.


31.14.3. Color Gradients


A color gradient is a background that changes its color gradually from one hue to a different one. Color gradients can be used by various commands and modules of fvwm. There are eight types of gradients: HGradient is a horizontal gradient, VGradient is vertical, DGradient is diagonal from top left to bottom right, BGradient is backwards diagonal from bottom left to top right, SGradient is concentric squares, CGradient is concentric circles, RGradient is a radar like pattern and YGradient is a Yin Yang style (but without the dots).


The color gradient syntax has two forms:


?Gradient colors start-color end-color


This form specifies a linear gradient. The arguments denote the total number of colors to allocate (between 2 and 1000), the initial color and the final color.


Example:


TitleStyle VGradient 20 rgb:b8/ce/bc rgb:5b/85/d0
?Gradient colors segments color length color [ length color ]...


The second form specifies a nonlinear gradient. The arguments are: the total number of colors to allocate (between 2 and 1000), then the number of segments. For each segment, specify the starting color, a relative length, then the ending color. Each subsequent segment begins with the second color of the last segment. The lengths may be any non-negative integers. The length of one segment divided by the sum of all segments lengths is the fraction of the colors that are used for the segment.


Examples:


MenuStyle * MenuFace DGradient 128 2 lightgrey 50 blue 50 white


# 20% gradient from red to blue,
# 30% from blue to black,
# 50% from black to grey
MenuStyle * MenuFace DGradient 100 3 Red 20 Blue 30 Black 50 Grey


# 50% from blue to green, then
# 50% from yellow to red

Colorset 0 HGradient 128 3 Blue 1000 Green 1 Yellow 1000 Red


环境变量


影响fvwm的环境变量有:


DISPLAY
Fvwm starts on this display unless the -display option is given.

FVWM_MODULEDIR
Set by fvwm to the directory containing the standard fvwm modules.


FVWM_USERDIR
Used to determine the user's data directory for reading and sometimes writing personal files. If this variable is not already set, it is set by fvwm to $HOME/.fvwm, which is the default user's data directory.


SESSION_MANAGER
Fvwm tries to contact this session manager.


SESSION_MANAGER_NAME
This is used mainly to determine xsm running to work around its bug. If this variable is set to "xsm", DiscardCommand is set as xsm expects it and not as XSMP requires. If you run fvwm under xsm, you should set this variable to "xsm", otherwise old state files are not removed.


SM_SAVE_DIR
If this is set, fvwm saves its session data in this directory. Otherwise it uses $HOME. Note, the state files are named .fs-?????? and normally are removed automatically when not used anymore.
原创粉丝点击