2019-07-16 11:52:22 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
2019-07-21 11:06:28 +02:00
|
|
|
#include <stdint.h>
|
2019-07-17 10:12:14 +02:00
|
|
|
#include <stdbool.h>
|
|
|
|
|
|
2019-12-01 13:43:51 +01:00
|
|
|
#include <tllist.h>
|
|
|
|
|
|
2019-07-22 20:15:14 +02:00
|
|
|
#include "terminal.h"
|
2020-07-30 18:57:21 +02:00
|
|
|
#include "user-notification.h"
|
2020-07-15 16:39:07 +02:00
|
|
|
#include "wayland.h"
|
2019-07-22 20:15:14 +02:00
|
|
|
|
2020-07-07 10:44:55 +02:00
|
|
|
struct config_font {
|
|
|
|
|
char *pattern;
|
|
|
|
|
double pt_size;
|
|
|
|
|
int px_size;
|
|
|
|
|
};
|
|
|
|
|
|
2020-07-15 16:39:07 +02:00
|
|
|
struct config_key_binding_normal {
|
|
|
|
|
enum bind_action_normal action;
|
|
|
|
|
char *key;
|
2020-07-30 18:53:51 +02:00
|
|
|
struct {
|
|
|
|
|
char *cmd;
|
|
|
|
|
char **argv;
|
|
|
|
|
} pipe;
|
2020-07-15 16:39:07 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct config_key_binding_search {
|
|
|
|
|
enum bind_action_search action;
|
|
|
|
|
char *key;
|
|
|
|
|
};
|
|
|
|
|
|
2019-07-16 11:52:22 +02:00
|
|
|
struct config {
|
2019-07-18 14:29:40 +02:00
|
|
|
char *term;
|
2019-07-17 09:29:56 +02:00
|
|
|
char *shell;
|
2020-04-01 19:59:47 +02:00
|
|
|
char *title;
|
2020-04-01 18:40:51 +02:00
|
|
|
char *app_id;
|
2020-02-20 18:35:10 +01:00
|
|
|
bool login_shell;
|
2019-08-23 17:26:41 +02:00
|
|
|
unsigned width;
|
|
|
|
|
unsigned height;
|
2020-02-15 19:00:56 +01:00
|
|
|
unsigned pad_x;
|
|
|
|
|
unsigned pad_y;
|
2020-03-26 19:39:12 +01:00
|
|
|
enum { STARTUP_WINDOWED, STARTUP_MAXIMIZED, STARTUP_FULLSCREEN } startup_mode;
|
2019-08-23 17:26:41 +02:00
|
|
|
|
2020-07-07 10:44:55 +02:00
|
|
|
tll(struct config_font) fonts;
|
2019-07-21 11:06:28 +02:00
|
|
|
|
2020-07-25 14:31:45 +02:00
|
|
|
struct {
|
|
|
|
|
int lines;
|
|
|
|
|
|
|
|
|
|
struct {
|
|
|
|
|
enum {
|
2020-07-27 20:02:51 +02:00
|
|
|
SCROLLBACK_INDICATOR_POSITION_NONE,
|
|
|
|
|
SCROLLBACK_INDICATOR_POSITION_FIXED,
|
|
|
|
|
SCROLLBACK_INDICATOR_POSITION_RELATIVE
|
|
|
|
|
} position;
|
2020-07-25 14:31:45 +02:00
|
|
|
|
|
|
|
|
enum {
|
2020-07-26 11:39:02 +02:00
|
|
|
SCROLLBACK_INDICATOR_FORMAT_PERCENTAGE,
|
2020-07-28 19:56:53 +02:00
|
|
|
SCROLLBACK_INDICATOR_FORMAT_LINENO,
|
|
|
|
|
SCROLLBACK_INDICATOR_FORMAT_TEXT,
|
2020-07-25 14:31:45 +02:00
|
|
|
} format;
|
2020-07-28 19:56:53 +02:00
|
|
|
|
|
|
|
|
wchar_t *text;
|
2020-07-25 14:31:45 +02:00
|
|
|
} indicator;
|
|
|
|
|
} scrollback;
|
2019-08-01 19:28:14 +02:00
|
|
|
|
2019-07-21 11:06:28 +02:00
|
|
|
struct {
|
|
|
|
|
uint32_t fg;
|
|
|
|
|
uint32_t bg;
|
|
|
|
|
uint32_t regular[8];
|
|
|
|
|
uint32_t bright[8];
|
2019-08-16 22:06:06 +02:00
|
|
|
uint16_t alpha;
|
2019-07-21 11:06:28 +02:00
|
|
|
} colors;
|
2019-07-22 20:15:14 +02:00
|
|
|
|
|
|
|
|
struct {
|
|
|
|
|
enum cursor_style style;
|
2020-06-30 17:45:34 +02:00
|
|
|
bool blink;
|
2020-07-31 17:09:06 +02:00
|
|
|
bool hide_when_typing;
|
2019-07-23 18:54:58 +02:00
|
|
|
struct {
|
|
|
|
|
uint32_t text;
|
|
|
|
|
uint32_t cursor;
|
|
|
|
|
} color;
|
2019-07-22 20:15:14 +02:00
|
|
|
} cursor;
|
2019-07-29 20:13:26 +02:00
|
|
|
|
2020-03-08 12:08:46 +01:00
|
|
|
struct {
|
|
|
|
|
/* Bindings for "normal" mode */
|
2020-07-15 16:39:07 +02:00
|
|
|
tll(struct config_key_binding_normal) key;
|
|
|
|
|
tll(struct mouse_binding) mouse;
|
2020-03-08 12:08:46 +01:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Special modes
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/* While searching (not - action to *start* a search is in the
|
|
|
|
|
* 'key' bindings above */
|
2020-07-15 16:39:07 +02:00
|
|
|
tll(struct config_key_binding_search) search;
|
2020-03-08 12:08:46 +01:00
|
|
|
} bindings;
|
|
|
|
|
|
2020-03-02 18:42:49 +01:00
|
|
|
struct {
|
|
|
|
|
enum { CONF_CSD_PREFER_SERVER, CONF_CSD_PREFER_CLIENT } preferred;
|
|
|
|
|
|
|
|
|
|
int title_height;
|
|
|
|
|
int border_width;
|
2020-03-02 20:29:28 +01:00
|
|
|
int button_width;
|
2020-03-02 18:42:49 +01:00
|
|
|
|
|
|
|
|
struct {
|
|
|
|
|
bool title_set;
|
2020-03-02 20:29:28 +01:00
|
|
|
bool minimize_set;
|
|
|
|
|
bool maximize_set;
|
|
|
|
|
bool close_set;
|
2020-03-02 18:42:49 +01:00
|
|
|
uint32_t title;
|
2020-03-02 20:29:28 +01:00
|
|
|
uint32_t minimize;
|
|
|
|
|
uint32_t maximize;
|
|
|
|
|
uint32_t close;
|
2020-03-02 18:42:49 +01:00
|
|
|
} color;
|
|
|
|
|
} csd;
|
|
|
|
|
|
2019-07-29 20:13:26 +02:00
|
|
|
size_t render_worker_count;
|
2019-12-14 12:59:06 +01:00
|
|
|
char *server_socket_path;
|
2019-12-31 15:39:40 +01:00
|
|
|
bool presentation_timings;
|
2020-02-03 19:58:32 +01:00
|
|
|
bool hold_at_exit;
|
2020-03-17 16:46:54 +01:00
|
|
|
|
|
|
|
|
struct {
|
|
|
|
|
uint64_t delayed_render_lower_ns;
|
|
|
|
|
uint64_t delayed_render_upper_ns;
|
2020-03-25 20:48:02 +01:00
|
|
|
off_t max_shm_pool_size;
|
2020-03-17 16:46:54 +01:00
|
|
|
} tweak;
|
2020-07-29 19:42:12 +02:00
|
|
|
|
2020-07-30 18:57:21 +02:00
|
|
|
user_notifications_t notifications;
|
2019-07-16 11:52:22 +02:00
|
|
|
};
|
|
|
|
|
|
2020-07-31 17:07:14 +02:00
|
|
|
bool config_load(struct config *conf, const char *path, bool errors_are_fatal);
|
2019-07-16 11:52:22 +02:00
|
|
|
void config_free(struct config conf);
|
2020-07-07 10:44:55 +02:00
|
|
|
|
|
|
|
|
struct config_font config_font_parse(const char *pattern);
|
|
|
|
|
void config_font_destroy(struct config_font *font);
|