aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikkel Oscar Lyderik <mikkeloscar@gmail.com>2016-03-28 19:38:19 +0200
committerMikkel Oscar Lyderik <mikkeloscar@gmail.com>2016-03-30 00:47:58 +0200
commitda567317ab27ec033fa53c6e4b4823dcfce7d24d (patch)
treecb1f9b26134b39c2605135142666994d122fe18c
parente2774aee3c80088c7509ed31ae00baee92d6c6ba (diff)
Make pango: prefix optional for font config
-rw-r--r--sway/commands.c12
-rw-r--r--sway/config.c2
2 files changed, 7 insertions, 7 deletions
diff --git a/sway/commands.c b/sway/commands.c
index 4d0da26e..333af1b4 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -1872,16 +1872,16 @@ static struct cmd_results *cmd_font(int argc, char **argv) {
}
char *font = join_args(argv, argc);
+ free(config->font);
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 {
+ 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);
}
diff --git a/sway/config.c b/sway/config.c
index 4a1cb2bb..4cb8cced 100644
--- a/sway/config.c
+++ b/sway/config.c
@@ -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;