Make pango: prefix optional for font config

master
Mikkel Oscar Lyderik 9 years ago
parent e2774aee3c
commit da567317ab

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

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

Loading…
Cancel
Save