This repository has been archived by the owner on Jun 1, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dwt-settings.c
134 lines (110 loc) · 4.95 KB
/
dwt-settings.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
/*
* dwt-settings.c
* Copyright (C) 2014 Adrian Perez <aperez@igalia.com>
*
* Distributed under terms of the MIT license.
*/
#include "dg-settings.h"
#ifndef DWT_DEFAULT_FONT
#define DWT_DEFAULT_FONT "monospace 11"
#endif /* !DWT_DEFAULT_FONT */
DG_SETTINGS_CLASS_DECLARE (DwtSettings, dwt_settings)
DG_SETTINGS_CLASS_DEFINE (DwtSettings, dwt_settings)
DG_SETTINGS_BOOLEAN ("allow-bold",
"Allow bold fonts",
"Whether to allow usage of bold fonts."
" Note that some type faces may not include"
" a bold variant, and a substitute font which"
" does not match well with the selected font"
" might be chosen, or the base font may be"
" emboldened to create a “fake bold” variant.",
TRUE);
DG_SETTINGS_BOOLEAN ("mouse-autohide",
"Autohide mouse pointer",
"Whether to automatically hide the mouse cursor"
" on key press when the cursor is over a terminal"
" window. To show the cursor again, move the mouse.",
TRUE);
DG_SETTINGS_BOOLEAN ("audible-bell",
"Audible terminal bell",
"Whether the terminal bell is audible (i.e. produces"
" sound.",
FALSE);
DG_SETTINGS_BOOLEAN ("show-title",
"Show window titles",
"Show title bars for maximized terminal windows.",
FALSE);
DG_SETTINGS_BOOLEAN ("update-title",
"Update window titles",
"Allow updating the titles of windows using the"
" same escape sequence used by XTerm.",
TRUE);
DG_SETTINGS_BOOLEAN ("no-header-bar",
"Do not use header bars",
"Let the window manager decorate windows instead."
" of using client-side header bars.",
FALSE);
DG_SETTINGS_UINT_RANGE ("scrollback",
"Scrollback size",
"Number of lines saved as scrollback buffer.",
0, 0, 10000);
DG_SETTINGS_STRING ("font",
"Font name",
"Name of the terminal font.",
DWT_DEFAULT_FONT);
DG_SETTINGS_STRING ("command",
"Command to run",
"Command to run instead of the user shell, if"
" flag '-e' is not specified during invocation.",
NULL);
DG_SETTINGS_STRING ("title",
"Default window title",
"Initial title to show on terminal windows, if not"
" changed using the XTerm title change escape"
" sequence.",
"dwt");
DG_SETTINGS_STRING ("icon",
"Terminal window icon",
"Name of the icon used for terminal windows, or"
" path to the file containing the image to be used"
" as icon.",
"terminal");
DG_SETTINGS_STRING ("cursor-color",
"Cursor color",
"Color of the cursor in active terminal windows,"
" in #RRGGBB hex format.",
"#AA0033");
DG_SETTINGS_STRING ("background-color",
"Background color",
"Terminal background color. Overrides the color"
" defined in the active theme.",
NULL);
DG_SETTINGS_STRING ("foreground-color",
"Foreground color",
"Terminal foreground color. Overrides the color"
" defined in the active theme.",
NULL);
DG_SETTINGS_STRING ("theme",
"Color theme",
"Name of the built-in color theme to be used for the"
" foreground, background, and the 16 basic terminal"
" colors.",
NULL);
DG_SETTINGS_CLASS_END
static gpointer
dwt_settings_create (gpointer dummy)
{
g_autofree char *path = g_build_filename (g_get_user_config_dir (),
g_get_prgname (),
NULL);
return g_object_new (dwt_settings_get_type (),
"settings-path", path,
"settings-monitoring-enabled", TRUE,
NULL);
}
DwtSettings*
dwt_settings_get_instance (void)
{
static GOnce instance_once = G_ONCE_INIT;
return g_once (&instance_once, dwt_settings_create, NULL);
}