2 * Copyright (C) 2003-2008 Kim Woelders
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to
6 * deal in the Software without restriction, including without limitation the
7 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
8 * sell copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies of the Software, its documentation and marketing & publicity
13 * materials, and acknowledgment shall be given in the documentation, materials
14 * and software packages that this Software was used.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30 /***********************************************************************
31 * *** should all go elsewhere ***
32 **********************************************************************/
34 /* Use static module list for now */
35 extern const EModule ModAclass;
36 extern const EModule ModBackgrounds;
37 extern const EModule ModButtons;
40 extern const EModule ModCompMgr;
41 extern const EModule ModMagwin;
44 extern const EModule ModGlwin;
46 extern const EModule ModCursors;
47 extern const EModule ModDesktops;
48 extern const EModule ModEffects;
49 extern const EModule ModEwins;
50 extern const EModule ModFocus;
51 extern const EModule ModGroups;
52 extern const EModule ModImageclass;
53 extern const EModule ModIconboxes;
54 extern const EModule ModLocale;
55 extern const EModule ModMenus;
56 extern const EModule ModMisc;
57 extern const EModule ModPagers;
58 extern const EModule ModSlideouts;
61 extern const EModule ModSound;
63 extern const EModule ModTextclass;
64 extern const EModule ModTheme;
65 extern const EModule ModTooltips;
67 #ifdef ENABLE_THEME_TRANSPARENCY
68 extern const EModule ModTransparency;
70 extern const EModule ModWarplist;
71 extern const EModule ModWindowMatch;
73 const EModule *p_modules[] = {
103 #ifdef ENABLE_THEME_TRANSPARENCY
109 int n_modules = sizeof(p_modules) / sizeof(EModule *);
113 MiscSighan(int sig, void *prm __UNUSED__)
124 _CfgImageCacheSize(void *item __UNUSED__, const char *value)
126 int size_old, size_new;
128 if (!value || !value[0])
131 size_new = atoi(value);
132 size_old = EImageSetCacheSize(size_new);
133 IpcPrintf("Image cache size %u->%u byte\n", size_old, size_new);
136 static const CfgItem MiscCfgItems[] = {
138 CFG_ITEM_INT(Conf, animation.step, 10),
140 CFG_ITEM_INT(Conf, buttons.move_resistance, 10),
142 CFG_ITEM_BOOL(Conf, dialogs.headers, 0),
143 CFG_ITEM_BOOL(Conf, dialogs.button_image, 0),
145 CFG_ITEM_BOOL(Conf, dock.enable, 1),
146 CFG_ITEM_BOOL(Conf, dock.sticky, 1),
147 CFG_ITEM_INT(Conf, dock.dirmode, DOCK_DOWN),
148 CFG_ITEM_INT(Conf, dock.startx, 0),
149 CFG_ITEM_INT(Conf, dock.starty, 0),
151 CFG_ITEM_BOOL(Conf, hints.set_xroot_info_on_root_window, 0),
153 CFG_ITEM_INT(Conf, movres.mode_move, 0),
154 CFG_ITEM_INT(Conf, movres.mode_resize, 2),
155 CFG_ITEM_INT(Conf, movres.mode_info, 1),
156 CFG_ITEM_INT(Conf, movres.mode_maximize_default, 1),
157 CFG_ITEM_HEX(Conf, movres.color, 0x00ff0000),
158 CFG_ITEM_BOOL(Conf, movres.avoid_server_grab, 1),
159 CFG_ITEM_BOOL(Conf, movres.update_while_moving, 0),
160 CFG_ITEM_BOOL(Conf, movres.enable_sync_request, 0),
161 CFG_ITEM_BOOL(Conf, movres.dragbar_nocover, 0),
163 CFG_ITEM_INT(Conf, opacity.menus, 85),
164 CFG_ITEM_INT(Conf, opacity.movres, 60),
165 CFG_ITEM_INT(Conf, opacity.tooltips, 80),
166 CFG_ITEM_INT(Conf, opacity.focused, 100),
167 CFG_ITEM_INT(Conf, opacity.unfocused, 100),
169 CFG_ITEM_BOOL(Conf, place.manual, 0),
170 CFG_ITEM_BOOL(Conf, place.manual_mouse_pointer, 0),
171 CFG_ITEM_BOOL(Conf, place.center_if_desk_full, 0),
172 CFG_ITEM_BOOL(Conf, place.ignore_struts, 0),
173 CFG_ITEM_BOOL(Conf, place.raise_fullscreen, 0),
174 CFG_ITEM_BOOL(Conf, place.slidein, 0),
175 CFG_ITEM_BOOL(Conf, place.cleanupslide, 1),
176 CFG_ITEM_INT(Conf, place.slidemode, 0),
177 CFG_ITEM_INT(Conf, place.slidespeedmap, 6000),
178 CFG_ITEM_INT(Conf, place.slidespeedcleanup, 8000),
180 CFG_ITEM_BOOL(Conf, session.enable_script, 0),
181 CFG_ITEM_STR(Conf, session.script),
182 CFG_ITEM_BOOL(Conf, session.enable_logout_dialog, 1),
183 CFG_ITEM_BOOL(Conf, session.enable_reboot_halt, 0),
184 CFG_ITEM_STR(Conf, session.cmd_reboot),
185 CFG_ITEM_STR(Conf, session.cmd_halt),
187 CFG_ITEM_BOOL(Conf, shading.animate, 1),
188 CFG_ITEM_INT(Conf, shading.speed, 8000),
190 CFG_ITEM_BOOL(Conf, snap.enable, 1),
191 CFG_ITEM_INT(Conf, snap.edge_snap_dist, 8),
192 CFG_ITEM_INT(Conf, snap.screen_snap_dist, 32),
194 CFG_ITEM_BOOL(Conf, startup.firsttime, 1),
195 CFG_ITEM_BOOL(Conf, startup.animate, 1),
197 CFG_ITEM_BOOL(Conf, testing.argb_internal_objects, 0),
198 CFG_ITEM_BOOL(Conf, testing.argb_internal_clients, 0),
199 CFG_ITEM_BOOL(Conf, testing.argb_clients, 0),
200 CFG_ITEM_BOOL(Conf, testing.argb_clients_inherit_attr, 0),
201 CFG_FUNC_INT(Conf, testing.image_cache_size, -1, _CfgImageCacheSize),
202 CFG_ITEM_INT(Conf, testing.mask_alpha_threshold, 8),
203 CFG_ITEM_BOOL(Conf, testing.enable_startup_id, 1),
204 CFG_ITEM_BOOL(Conf, testing.use_render_for_scaling, 0),
205 CFG_ITEM_BOOL(Conf, testing.bindings_reload, 1),
206 CFG_ITEM_HEX(Conf, testing.no_sync_mask, 0),
208 CFG_ITEM_BOOL(Conf, autosave, 1),
209 CFG_ITEM_BOOL(Conf, memory_paranoia, 1),
210 CFG_ITEM_BOOL(Conf, save_under, 0),
211 CFG_ITEM_BOOL(Conf, difftime, 0),
213 #define N_CFG_ITEMS ((int)(sizeof(MiscCfgItems)/sizeof(CfgItem)))
215 /* Stuff not elsewhere */
216 const EModule ModMisc = {
220 {N_CFG_ITEMS, MiscCfgItems}
226 if (!Mode.wm.save_ok)
229 if (EDebug(EDBUG_TYPE_SESSION))
230 Eprintf("autosave\n");
232 SnapshotsSaveReal(NULL);
234 /* Save the configuration parameters */