2025-12-28 03:14:31 +01:00
|
|
|
/*
|
|
|
|
|
* DWN - Desktop Window Manager
|
2025-12-28 04:30:10 +01:00
|
|
|
* retoor <retoor@molodetz.nl>
|
2025-12-28 03:14:31 +01:00
|
|
|
* Configuration system
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef DWN_CONFIG_H
|
|
|
|
|
#define DWN_CONFIG_H
|
|
|
|
|
|
|
|
|
|
#include "dwn.h"
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
unsigned long panel_bg;
|
|
|
|
|
unsigned long panel_fg;
|
|
|
|
|
unsigned long workspace_active;
|
|
|
|
|
unsigned long workspace_inactive;
|
|
|
|
|
unsigned long workspace_urgent;
|
|
|
|
|
unsigned long title_focused_bg;
|
|
|
|
|
unsigned long title_focused_fg;
|
|
|
|
|
unsigned long title_unfocused_bg;
|
|
|
|
|
unsigned long title_unfocused_fg;
|
|
|
|
|
unsigned long border_focused;
|
|
|
|
|
unsigned long border_unfocused;
|
|
|
|
|
unsigned long notification_bg;
|
|
|
|
|
unsigned long notification_fg;
|
|
|
|
|
} ColorScheme;
|
|
|
|
|
|
|
|
|
|
struct Config {
|
|
|
|
|
char terminal[128];
|
|
|
|
|
char launcher[128];
|
|
|
|
|
char file_manager[128];
|
|
|
|
|
FocusMode focus_mode;
|
2025-12-28 10:23:03 +01:00
|
|
|
int focus_follow_delay_ms;
|
2025-12-28 03:14:31 +01:00
|
|
|
bool show_decorations;
|
|
|
|
|
|
|
|
|
|
int border_width;
|
|
|
|
|
int title_height;
|
|
|
|
|
int panel_height;
|
|
|
|
|
int gap;
|
|
|
|
|
char font_name[128];
|
|
|
|
|
ColorScheme colors;
|
|
|
|
|
|
|
|
|
|
float default_master_ratio;
|
|
|
|
|
int default_master_count;
|
|
|
|
|
LayoutType default_layout;
|
|
|
|
|
|
|
|
|
|
bool top_panel_enabled;
|
|
|
|
|
bool bottom_panel_enabled;
|
|
|
|
|
|
|
|
|
|
char openrouter_api_key[256];
|
|
|
|
|
char exa_api_key[256];
|
|
|
|
|
char ai_model[64];
|
|
|
|
|
bool ai_enabled;
|
|
|
|
|
|
|
|
|
|
char config_path[512];
|
|
|
|
|
char log_path[512];
|
2025-12-28 09:26:53 +01:00
|
|
|
|
|
|
|
|
bool autostart_enabled;
|
|
|
|
|
bool autostart_xdg;
|
|
|
|
|
char autostart_path[512];
|
2025-12-28 10:23:03 +01:00
|
|
|
|
2026-01-08 23:58:19 +01:00
|
|
|
char services_path[512];
|
|
|
|
|
bool api_enabled;
|
|
|
|
|
int api_port;
|
|
|
|
|
|
2025-12-28 10:23:03 +01:00
|
|
|
int demo_step_delay_ms;
|
|
|
|
|
int demo_ai_timeout_ms;
|
|
|
|
|
int demo_window_timeout_ms;
|
2025-12-28 03:14:31 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Config *config_create(void);
|
|
|
|
|
void config_destroy(Config *cfg);
|
|
|
|
|
bool config_load(Config *cfg, const char *path);
|
|
|
|
|
bool config_reload(Config *cfg);
|
|
|
|
|
void config_set_defaults(Config *cfg);
|
|
|
|
|
|
|
|
|
|
const char *config_get_terminal(void);
|
|
|
|
|
const char *config_get_launcher(void);
|
|
|
|
|
int config_get_border_width(void);
|
|
|
|
|
int config_get_title_height(void);
|
|
|
|
|
int config_get_panel_height(void);
|
|
|
|
|
int config_get_gap(void);
|
|
|
|
|
const ColorScheme *config_get_colors(void);
|
|
|
|
|
|
|
|
|
|
typedef void (*ConfigCallback)(const char *section, const char *key,
|
|
|
|
|
const char *value, void *user_data);
|
|
|
|
|
bool config_parse_ini(const char *path, ConfigCallback callback, void *user_data);
|
|
|
|
|
|
2025-12-28 05:01:46 +01:00
|
|
|
#endif
|