|
13 | 13 |
|
14 | 14 | struct GtkLock *gtklock = NULL;
|
15 | 15 |
|
16 |
| -static char *style_path = NULL; |
17 |
| -static char *module_path = NULL; |
18 |
| - |
19 | 16 | static gboolean should_daemonize = FALSE;
|
20 | 17 | static gboolean no_layer_shell = FALSE;
|
21 | 18 | static gboolean no_input_inhibit = FALSE;
|
22 | 19 |
|
23 |
| -static pid_t parent = -2; |
| 20 | +static char *gtk_theme = NULL; |
| 21 | + |
| 22 | +static char *style_path = NULL; |
| 23 | +static char *module_path = NULL; |
24 | 24 |
|
25 | 25 | static GOptionEntry entries[] = {
|
26 | 26 | { "daemonize", 'd', 0, G_OPTION_ARG_NONE, &should_daemonize, "Detach from the controlling terminal after locking", NULL },
|
27 | 27 | { "no-layer-shell", 'l', 0, G_OPTION_ARG_NONE, &no_layer_shell, "Don't use wlr-layer-shell", NULL },
|
28 | 28 | { "no-input-inhibit", 'i', 0, G_OPTION_ARG_NONE, &no_input_inhibit, "Don't use wlr-input-inhibitor", NULL },
|
29 |
| - { "style", 's', 0, G_OPTION_ARG_FILENAME, &style_path, "CSS style to use", NULL }, |
30 |
| - { "module", 'm', 0, G_OPTION_ARG_FILENAME, &module_path, "gtklock module to use", NULL }, |
| 29 | + { "gtk-theme", 'g', 0, G_OPTION_ARG_STRING, >k_theme, "Set GTK theme", NULL }, |
| 30 | + { "style", 's', 0, G_OPTION_ARG_FILENAME, &style_path, "Load CSS style file", NULL }, |
| 31 | + { "module", 'm', 0, G_OPTION_ARG_FILENAME, &module_path, "Load gtklock module", NULL }, |
31 | 32 | { NULL },
|
32 | 33 | };
|
33 | 34 |
|
| 35 | +static pid_t parent = -2; |
| 36 | + |
34 | 37 | static void reload_outputs(void) {
|
35 | 38 | GdkDisplay *display = gdk_display_get_default();
|
36 | 39 |
|
@@ -156,6 +159,11 @@ int main(int argc, char **argv) {
|
156 | 159 | if(!g_option_context_parse(option_context, &argc, &argv, &error))
|
157 | 160 | g_error("Option parsing failed: %s\n", error->message);
|
158 | 161 |
|
| 162 | + if(gtk_theme) { |
| 163 | + GtkSettings *settings = gtk_settings_get_default(); |
| 164 | + g_object_set(settings, "gtk-theme-name", gtk_theme, NULL); |
| 165 | + } |
| 166 | + |
159 | 167 | gtklock = create_gtklock();
|
160 | 168 | gtklock->use_layer_shell = !no_layer_shell;
|
161 | 169 | gtklock->use_input_inhibit = !no_input_inhibit;
|
|
0 commit comments