KAHAKAISection: User Manual (1)Updated: Nov 15 2002 |
KAHAKAISection: User Manual (1)Updated: Nov 15 2002 |
Kahakai is a fork of the Waimea window manager, with the goal of allowing as much internal customization as possible. Kahakai uses SWIG to provide wrappers that allow high-level scripting languages to access the internals of the core of the window manager, which is written in C++.
When running Kahakai on display with multiple screens the screen0 key in the following configuration options can also be screen1, 2 etc. for any appropriate screen.
Dockappholder Resources
It is possible to have more than one dockappholder running. First dockappholder should be named dock0 and the second dock1 and so on. One dockappholder is always running whether you have a dock0 line in your CONFIGFILE or not.
Example:
screen0.dock0.order: n/.*meter$/ c/pager/
This will put dockapp window with name ending with `meter' at the first position in dockappholder and dockapp with classname containing `pager' at second position. All dockapp windows that doesn't match any regular expression will be put in last dockapp at last position.
Kahakai allows you to configure the style of menus and the windows. Dockappholders use the same style as the windows.
Here are the different types of values:
-adobe-courier-medium-r-normal--10-100-75-75-m-60-iso8859-1The format for Xft font names is:
<family>-<size>:<name>=<value> [xft]
An arbitrary set of additional elements can be appended to the Xft font name, the complete list of possible properties is:
Name Type --------------------------------- family String style String slant Int weight Int size Double aspect Double (only in Xft2) pixelsize Double encoding String (only in Xft1) spacing Int foundry String core Bool (only in Xft1) antialias Bool xlfd String (only in Xft1) file String index Int rasterizer String outline Bool scalable Bool rgba Int (Defaults from resources) scale Double render Bool (only in Xft1) minspace Bool (Specific to FreeType rasterizer) charwidth Int charheight Int matrix XftMatrix charset CharSet (only in Xft2) lang String (only in Xft2)
As family and size are both nearly always needed to access a Xft font, they're given a privileged place, but really they're no different than the remaining values. For elements that use an enumerated list of possible values, the values are given names which can be used in place of an integer, or can actually replace the whole name=value part. They're all unique, so this actually works. Here's a list of all of the enumerated values and the associated name:
Value Element --------------------------------- light weight medium weight demibold weight bold weight black weight roman slant italic slant oblique slant proportional spacing mono spacing charcell spacing rgb rgba bgr rgba vrgb rgba vbgr rgba
Some example Xft font names:
times-12 [xft]12 point times
times,charter-12:bold [xft]12 point, preferring 'times', but accepting 'charter', bold.
times-12:bold:slant=italic,oblique [xft]12 point times bold, either italic or oblique
times-12:rgba=vbgr [xft]12 point times, optimized for display on an LCD screen with sub-pixel elements arranged vertically with blue on the top and red on the bottom.
times:pixelsize=100 [xft]100 pixel times -- pixel size overrides any point size
window.label: Raised Gradient Diagonal Bevel1A texture description consists of up to five fields, which are as follows:
Flat / Raised / Sunkengives the component either a flat, raised or sunken appearance.
Gradient / Solid / Pixmaptells Kahakai to draw either a solid color or a gradiented texture.
Horizontal / Vertical / Diagonal / Crossdiagonal / Pipecross / Elliptic / Rectangle / Pyramid
Select one of these texture types. They only work when also Gradient is specified!
Tiled / Scaled / Stretched
Select one of these resizing methods. They only work when also Pixmap is specified!. Tiled resizing does not resize the image just tiles it, fastest method. Scaled resizing performs a normal scaling of image, all parts of the image are scaled equally. Stretched resizing only scales the middle part of the image, all borders are preserved.
Interlacedtells Kahakai to interlace the texture (darken every other line). This option is most commonly used with gradiented textures, but it also works in solid textures.
Bevel1 / Bevel2tells Kahakai which 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.
Instead of a texture description, also the option ParentRelative is available, which makes the component appear as a part of its parent, totally transparant.
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.
A image file must be specified for all pixmap textures. pixmap resources is used for finding the image file. Must be either a complete file path, a file path relative to Kahakai start directory or an image file in the same directory as the style file.
{ LEFT, RIGHT, TOP, BOTTOM }
LEFT being the width of left border, RIGHT being the width of right border,
TOP being the height of top border and BOTTOM being the height of bottom
border. Only graphics not within any of the borders will be scaled when
stretching pixmap.
Here are the keys Kahakai understands together with the value they should contain.
Window Keys
Controls the look of the window decorations. The '*' in the window keys can
be one of:
title, label, handle, button
or
grip.
window.*.focus: Texture description
window.*.focus.opacity: Texture opacity level
window.*.focus.color: Color
window.*.focus.colorTo: Color
window.*.focus.pixmap: Pixmap
window.*.focus.border: Border
window.*.unfocus: Texture description
window.*.unfocus.opacity: Texture opacity level
window.*.unfocus.color: Color
window.*.unfocus.colorTo: Color
window.*.unfocus.pixmap: Pixmap
window.*.unfocus.border: Border
window.label.focus.textColor: Color
window.label.focus.textColor.opacity: Xft opacity level
window.label.focus.textShadowColor: Color
window.label.focus.textShadowColor.opacity: Xft opacity level
window.label.focus.textShadowXOffset: Integer
window.label.focus.textShadowYOffset: Integer
window.label.unfocus.textColor: Color
window.label.unfocus.textColor.opacity: Xft opacity level
window.label.unfocus.textShadowColor: Color
window.label.unfocus.textShadowColor.opacity: Xft opacity level
window.label.unfocus.textShadowXOffset: Integer
window.label.unfocus.textShadowYOffset: Integer
Menu Keys
Controls the look of the menus. The '*' in the menu keys can be
one of:
title, frame
or
hilite.
menu.*: Texture description
menu.*.opacity: Texture opacity level
menu.*.color: Color
menu.*.colorTo: Color
menu.*.pixmap: Pixmap
menu.*.border: Border
menu.*.textColor: Color
menu.*.textColor.opacity: Xft opacity level
menu.*.textShadowColor: Color
menu.*.textShadowColor.opacity: Xft opacity level
menu.*.textShadowXOffset: Integer
menu.*.textShadowYOffset: Integer
Dockappholder Keys
Controls the look of the dockappholders. A different texture can be assigned
to each dockappholder. '[ID]' should be replaced by a dockappholder ID number.
A dockappholder ID is >=0 and depends on the dockappholder configuration in
the rc-file.
dockappholder.dock[ID].frame: Texture description
dockappholder.dock[ID].frame.opacity: Opacity level
dockappholder.dock[ID].frame.color: Color
dockappholder.dock[ID].frame.colorTo: Color
dockappholder.dock[ID].frame.pixmap: Pixmap
dockappholder.dock[ID].frame.border: Border
Button Keys
Controls the look of the titlebar buttons. For backwards compatibility with
blackbox styles
Kahakai
still understands the above mentioned window.button.* key, but
Kahakai
have a much more advanced configuration system for titlebar buttons. The
Kahakai
titlebar configuration system allows you to have any number of titlebar buttons
and the position and look for each button can be specified.
A titlebar button works just like a checkbox. It has two states, a 'false' state and a 'true' state. Which state the button is in depends on a variable and the look of each of these states can be specified. The '[ID]' must be a number >= 0. For Kahakai to read button configuration with an ID of 2, there must be a configuration with an ID of 0 and an ID of 1, this is because Kahakai stops reading button configurations when it comes to missing ID.
When set to None, titlebar button will only have one state (false state). Default is None.
window.button[ID].[STATE].focus: Texture description
window.button[ID].[STATE].focus.opacity: Opacity level
window.button[ID].[STATE].focus.color: Color
window.button[ID].[STATE].focus.colorTo: Color
window.button[ID].[STATE].focus.pixmap: Pixmap
window.button[ID].[STATE].focus.border: Border
window.button[ID].[STATE].unfocus: Texture description
window.button[ID].[STATE].unfocus.opacity: Opacity level
window.button[ID].[STATE].unfocus.color: Color
window.button[ID].[STATE].unfocus.colorTo: Color
window.button[ID].[STATE].focus.border: Border
window.button[ID].[STATE].unfocus.pixmap: Pixmap
window.button[ID].[STATE].pressed: Texture description
window.button[ID].[STATE].pressed.opacity: Opacity level
window.button[ID].[STATE].pressed.color: Color
window.button[ID].[STATE].pressed.colorTo: Color
window.button[ID].[STATE].pressed.pixmap: Pixmap
window.button[ID].[STATE].pressed.border: Border
Default style file is /usr/share/kahakai/styles/Default. You can study or edit this style to grasp how the style mechanism works.
All menus must be defined in the menu file.
A menu definition starts with a [start] tag and ends with an [end] tag. Between the [start] and the [end] tag a number of [item], [title], [sub] and [checkbox] tags should be placed. The looks and action lists are the only things separating the first three menu item types. All three of these tags could be followed by a (string), "string", {string} and <string>. A [checkbox] tag is basically an [item] tag with two states.
Kahakai menu system is compatible with blackbox(1) menu system, so higher level tags as [begin], [exec], [submenu], [nop], [restart] and [exit] are supported. blackbox(1) also supports [styledir], [reconfig] and [config] tags, these tags are not used by Kahakai.
() = menu item title
"" = action
{} = command line
<> = sub menu
e.g.:
[start] (menu)
[title] (Menu)
[item] (Xterm) {xterm}
[sub] (Programs) <progs>
[item] (Restart) "restart"
[item] (Exit) "exit"
[end]
It is possible to start defining a new menu within another menu.
e.g.:
[start] (menu)
[start] (menu2)
[item] (not smart) {rm -rf ~}
[end]
[sub] <menu2>
[end]
[include] tags can be used anywhere in a menu file to include the contains of another file. e.g.:
[include] (/home/user/.waimea/rootmenu)
Environment Variables And Window Info Expansion
Menu item titles include filenames and submenu references can
contain environment variables. e.g.:
[item] (Logout $USER) "exit"$USER will be replaced with USER environment variable.
Menu mapped by event occurring on a window.* window can contain special window info character sequences. These character sequences are expanded with the current window info when menu is mapped. e.g.:
[item] (win name: \n)Will be expanded to:
[item] (win name: windowname)Where windowname is the actual class name of the window.
"\c" Window class "\n" Window class name "\h" Host name for window owner "\p" PID of window ownerIf some window info isn't known for a window, the character sequence used for expanding this info will be replaced with an empty string.
All special characters need to be escaped (with a `\') to protect them from expansion. Special characters are:
( ) { } < > [ ] " $
Checkboxes
A checkbox item is a item that have two states and a flag decides which
state the item is in. e.g.:
[checkbox=STICKY] @FALSE (Sticky) "sticky" @TRUE (Sticky) "unsticky"Flag to decide which mode to be in for this checkbox is STICKY (the sticky flag for a window). If STICKY flag is 'False' the checkbox item will be in mode defined by menu string after @FALSE and if STICKY flag is 'True' the checkbox item will be in mode defined by the menu string after @TRUE.
Here is the list of flags that can be used with checkbox items:
MAXIMIZED
MINIMIZED
SHADED
STICKY
ALWAYSONTOP
ALWAYSATBOTTOM
DECORTITLE
DECORHANDLE
DECORBORDER
FULLSCREEN
Taskswitcher
Predefined menu named "__windowlist__" can be used in menu file
and scripts to access the taskswitcher menu.
Window merging
Predefined menus named "__mergelist__", "__mergelist_vertically__" and
"__mergelist_horizontally__" can be used in menu file
and scripts to access window merging menus.
Dynamic menus
Kahakai supports dynamic menus. A Dynamic menu is a menu that is
generated when mapped. Compared to a normal static menu that must be fully
defined in the
MENUFILE
the definition of a dynamic menu only consists of a command line.
The command line is executed when the menu is to be mapped and the
standard output from the command is parsed in the same way as the
MENUFILE
to generate the dynamic menu. Every time the menu is remapped the command
line is executed and a new menu is generated. A dynamic menu is defined
as a submenu link in the
MENUFILE
or as a menu_name parameter to one of the
menumap
actions. A dynamic menu definition must start with a '!' character and be
followed by a command line. e.g.:
[sub] (Styles) <!styledir.pl>Creates a submenu item with title 'Styles' and the submenu for the item is dynamic menu created by execution of styledir.pl script. Dynamic menus can contain definitions of other dynamic menus.
Default menu file is /usr/share/kahakai/menu. You can study or edit this menu file to grasp how the menu system works.
Bug reports, patches, suggestions, and insults are welcomed and appreciated, please file them in the appropriate area on http://sf.net/kahakai
The Kahakai website: http://kahakai.sf.net