The majority of this section is taken from or heavily influenced by the man page as of Fluxbox 0.1.13. Usually, the man page is the definite authority on this matter, but this document might be more enlightening to the beginning style author.
Для того, чтобы понять, как работает механизм стилей, вам нужно немного узнать о том, как работают ресурсы X11.
X11 resources consist of a key and a value. The key is constructed of several smaller keys (sometimes referred to as children), delimited by a period (.). Keys may also contain a asterisk (*) to serve as a wildcard, which means that one line of typed text will match several keys. This is useful for styles that are based on one or two colors.
Fluxbox позволяет вам настраивать три его основные компоненты: панель задач, меню и декорации окон. Слит автоматически использует стиль панели задач, но это может быть изменено, если нужно. Маленькое окошко, которое показывает x-y позицию окон при их перетаскивании использует стиль заголовка окна.
Вот несколько маленьких примеров, иллюстрирующих основы синтаксиса:
Это устанавлиет цвет часов на панели задач в значение green. Другой пример:
Это устанавливает цвет меню rgb:3/4/5. Описания названий цветов читайте man страницы X11. Это также применимо для menu.title.color и menu.frame.color. И ещё пример:
Так вы одновременно устанавливаете шрифт для всех элементов. Для того, чтобы получить информацию о шрифтах, установленных на вашей стстеме, используйте такие программы как xfontsel, gfontsel, или xlsfonts.
И наконец то, что делает Fluxbox таким эффектным - это возможность рендерить текстуры "на лету". Texture descriptions are specified directly to the key that they should apply to, e.g.:
Пример 9-4. Стиль текстур
toolbar.clock: Raised Gradient Diagonal Bevel1
toolbar.clock.color: rgb:8/6/4
toolbar.clock.colorTo: rgb:4/3/2Не волнуйтесь, сейчас вы узнаете как работают эти директивы. Описание текстуры состоит из следующих пяти полей:
Таблица 9-1. Директивы текстур
| Директива | Описание |
|---|---|
| Flat / Raised / Sunken | Делает компонент плоским, поднятым или опущенным. |
| Gradient / Solid | draw either a solid color or a gradiented texture. |
| Horizontal / Vertical / Diagonal / Crossdiagonal / Pipecross / Elliptic / Rectangle / Pyramid | Выбрать тип текстуры. Роботает только когда используется Gradient. |
| Interlaced | interlace the texture (darken every other line). This option is most commonly used with gradiented textures, but from Blackbox version 0.60.3 on (and thus in all versions of Fluxbox), it also works in solid textures. |
| Bevel1 / Bevel2 | type of bevel to use. Bevel1 is the default bevel. The shading is placed on the edge of the image. Bevel2 is an alternative. The shading is placed one pixel in from the edge of the image. |
Apart from the texture description, the option ParentRelative is also available, which makes the component appear as a part of its parent.
All gradiented textures are composed of two color values: the color and colorTo resources. When Interlaced is used in Solid mode, the colorTo resource is used to find the interlacing color.
Полный лист компонент может быть найден в Прил. C.
Now, that seems a long list, but remember, when you create your own style, you can easily set lots of keys with a single command, e.g.
| Пред. | Начало | След. |
| Темы | Уровень выше | Настройка .xinitrc/.xsession |