Make pango: prefix optional for font config

This commit is contained in:
Mikkel Oscar Lyderik 2016-03-28 19:38:19 +02:00
parent e2774aee3c
commit da567317ab
2 changed files with 7 additions and 7 deletions

View file

@ -1872,16 +1872,16 @@ static struct cmd_results *cmd_font(int argc, char **argv) {
}
char *font = join_args(argv, argc);
if (strlen(font) > 6 && strncmp("pango:", font, 6) == 0) {
free(config->font);
config->font = font;
sway_log(L_DEBUG, "Settings font %s", config->font);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
} else {
if (strlen(font) > 6 && strncmp("pango:", font, 6) == 0) {
config->font = strdup(font + 6);
free(font);
return cmd_results_new(CMD_FAILURE, "font", "non-pango font detected");
} else {
config->font = font;
}
sway_log(L_DEBUG, "Settings font %s", config->font);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}

View file

@ -160,7 +160,7 @@ static void config_defaults(struct sway_config *config) {
config->resizing_key = M_RIGHT_CLICK;
config->default_layout = L_NONE;
config->default_orientation = L_NONE;
config->font = strdup("pango:monospace 10");
config->font = strdup("monospace 10");
// Flags
config->focus_follows_mouse = true;