Catch parameters '-W' and '--parent-wid' to get the window id

pull/4/head
Moritz Luedecke 7 years ago
parent f2f7ec7608
commit 301e7de62f

@ -582,12 +582,6 @@ main(int argc, char *argv[]) {
/* Read the file. If there is an error, report it and exit. */
if (config_read_file(&cfg, path)) {
if (config_lookup_string(&cfg, "asterisk", &str)) {
config_error_line(&cfg), config_error_text(&cfg));
config_destroy(&cfg);
return(EXIT_FAILURE);
}
if (config_lookup_string(&cfg, "asterisk", &str)) {
asterisk = str;
}
@ -603,7 +597,6 @@ main(int argc, char *argv[]) {
if (config_lookup_string(&cfg, "prompt", &str)) {
prompt = str;
}
if (config_lookup_string(&cfg, "font", &str)) {
fonts[0] = str;
}
@ -631,8 +624,24 @@ main(int argc, char *argv[]) {
if (config_lookup_string(&cfg, "desc_fg", &str)) {
colors[SchemeDesc][ColFg] = str;
}
if (config_lookup_string(&cfg, "window_id", &str)) {
embed = str;
if (config_lookup_bool(&cfg, "windowed", &bval)) {
windowed = bval;
}
} else if (str = config_error_file(&cfg)) {
fprintf(stderr, "%s:%d: %s\n", config_error_file(&cfg),
config_error_line(&cfg), config_error_text(&cfg));
return(EXIT_FAILURE);
} else {
printf("No config file found. Use defaults.\n");
}
for (i = 0; i < argc; i++) {
if (!strcmp(argv[i], "-W") || !strcmp(argv[i], "--parent-wid")) {
if (windowed) {
embed = argv[++i];
printf("-> embed: %s\n", embed);
}
}
}
pinentry_init("pinentry-dmenu");

Loading…
Cancel
Save