doc: Document openbox configuration.
doc/openbox.md unknown status 1
1 | + | Openbox | |
2 | + | ======= | |
3 | + | ||
4 | + | Openbox is a simple window manager that lets you configure the appearance of | |
5 | + | windows, menus, shortcuts and autostarted programs. The `(home openbox)` module | |
6 | + | provides configuration options for openbox. | |
7 | + | ||
8 | + | Main Configuration | |
9 | + | ------------------ | |
10 | + | ||
11 | + | Openbox is configured by using the `openbox-home` procedure. | |
12 | + | ||
13 | + | **Scheme Procedure**: (openbox-home config) | |
14 | + | ||
15 | + | Generates configuration files for openbox, according to config, an | |
16 | + | openbox-configuration object. | |
17 | + | ||
18 | + | **Data Type**: openbox-configuration | |
19 | + | ||
20 | + | Data type that represents the Openbox configuration. This data type has the | |
21 | + | following fields: | |
22 | + | ||
23 | + | * **autostart** (default #f): the content of the autostart script. It can be | |
24 | + | #f if no script needs to be run at startup, or a file-like object. | |
25 | + | * **environ** (default #f): the content of the environ file. It can be #f if no | |
26 | + | environment variable needs to be loaded at startup, or a file-like object. | |
27 | + | * **menus** (default '()): the list of menus that can be added to the root menu. | |
28 | + | * **root-elements** (default '()): the list of menu elements that are to be added | |
29 | + | to the root menu. | |
30 | + | * **rc** (default #f): the content of the rc file. It can be #f if no specific | |
31 | + | configuration is needed, or a file-like object. | |
32 | + | ||
33 | + | Example Configuration | |
34 | + | --------------------- | |
35 | + | ||
36 | + | ```scheme | |
37 | + | (openbox-home | |
38 | + | (openbox-configuration | |
39 | + | (autostart (local-file "files/autostart")) | |
40 | + | (menus | |
41 | + | (list | |
42 | + | (openbox-menu | |
43 | + | (id "apps-game-menu") | |
44 | + | (label "Games") | |
45 | + | (elements | |
46 | + | (list | |
47 | + | (openbox-element-execute | |
48 | + | (label "MineTest") | |
49 | + | (command (file-append minetest "/bin/minetest"))) | |
50 | + | (openbox-element-execute | |
51 | + | (label "harmonist") | |
52 | + | (command (file-append harmonist "/bin/harmonist"))) | |
53 | + | (openbox-element-execute | |
54 | + | (label "Xonotic") | |
55 | + | (command (file-append xonotic "/bin/xonotic")))))))) | |
56 | + | (root-elements | |
57 | + | (list | |
58 | + | (openbox-element-menu (id "apps-game-menu")) | |
59 | + | (openbox-element-execute | |
60 | + | (label "Terminal") | |
61 | + | (command (file-append xfce4-terminal "/bin/xfce4-terminal"))) | |
62 | + | (openbox-element-execute | |
63 | + | (label "Icecat") | |
64 | + | (command (file-append icecat "/bin/icecat -P --no-remote"))) | |
65 | + | (openbox-element-execute | |
66 | + | (label "File Manager") | |
67 | + | (command (file-append pcmanfm "/bin/pcmanfm"))))) | |
68 | + | (rc (local-files "files/openbox-rc")))) | |
69 | + | ``` | |
70 | + | ||
71 | + | Menu Configuration | |
72 | + | ------------------ | |
73 | + | ||
74 | + | Menus in Openbox can be configured with the following data types: | |
75 | + | ||
76 | + | **Data Type**: openbox-menu | |
77 | + | ||
78 | + | This data type represents the content of a menu. This data type has the following | |
79 | + | fields: | |
80 | + | ||
81 | + | * **id**: a unique identifier used to link to that menu in the parent menu | |
82 | + | * **label**: a label shown in the parent menu that opens this menu | |
83 | + | * *elements**: the elements of the menu | |
84 | + | ||
85 | + | **Data Type**: openbox-element-menu | |
86 | + | ||
87 | + | This data type represents a menu, as an element of another menu. This data type | |
88 | + | has the following fields: | |
89 | + | ||
90 | + | * **id**: the id of the menu that is opened by this element | |
91 | + | ||
92 | + | **Data Type**: openbox-element-execute | |
93 | + | ||
94 | + | This data type represents a menu element that is something to execute when the | |
95 | + | user clicks on it. This data type has the following fields: | |
96 | + | ||
97 | + | * **label**: a label shown in the parent menu that executes this element | |
98 | + | * **command**: the command to execute when the user clicks on this menu element. | |
99 | + | It can be a string or a g-expression, as seen in the first example. | |
100 | + | * **notify?** (default #t): whether to use startupnotify | |
100 | < | ||
0 | 101 | < | \ No newline at end of file |