diff options
author | Mikkel Oscar Lyderik <mikkeloscar@gmail.com> | 2016-03-28 19:38:19 +0200 |
---|---|---|
committer | Mikkel Oscar Lyderik <mikkeloscar@gmail.com> | 2016-03-30 00:47:58 +0200 |
commit | da567317ab27ec033fa53c6e4b4823dcfce7d24d (patch) | |
tree | cb1f9b26134b39c2605135142666994d122fe18c | |
parent | Add default border colors (diff) | |
download | sway-da567317ab27ec033fa53c6e4b4823dcfce7d24d.tar.gz sway-da567317ab27ec033fa53c6e4b4823dcfce7d24d.tar.zst sway-da567317ab27ec033fa53c6e4b4823dcfce7d24d.zip |
Make pango: prefix optional for font config
-rw-r--r-- | sway/commands.c | 12 | ||||
-rw-r--r-- | sway/config.c | 2 |
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) { | |||
1872 | } | 1872 | } |
1873 | 1873 | ||
1874 | char *font = join_args(argv, argc); | 1874 | char *font = join_args(argv, argc); |
1875 | free(config->font); | ||
1875 | if (strlen(font) > 6 && strncmp("pango:", font, 6) == 0) { | 1876 | if (strlen(font) > 6 && strncmp("pango:", font, 6) == 0) { |
1876 | free(config->font); | 1877 | config->font = strdup(font + 6); |
1877 | config->font = font; | ||
1878 | sway_log(L_DEBUG, "Settings font %s", config->font); | ||
1879 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | ||
1880 | } else { | ||
1881 | free(font); | 1878 | free(font); |
1882 | return cmd_results_new(CMD_FAILURE, "font", "non-pango font detected"); | 1879 | } else { |
1880 | config->font = font; | ||
1883 | } | 1881 | } |
1884 | 1882 | ||
1883 | sway_log(L_DEBUG, "Settings font %s", config->font); | ||
1884 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | ||
1885 | } | 1885 | } |
1886 | 1886 | ||
1887 | 1887 | ||
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) { | |||
160 | config->resizing_key = M_RIGHT_CLICK; | 160 | config->resizing_key = M_RIGHT_CLICK; |
161 | config->default_layout = L_NONE; | 161 | config->default_layout = L_NONE; |
162 | config->default_orientation = L_NONE; | 162 | config->default_orientation = L_NONE; |
163 | config->font = strdup("pango:monospace 10"); | 163 | config->font = strdup("monospace 10"); |
164 | 164 | ||
165 | // Flags | 165 | // Flags |
166 | config->focus_follows_mouse = true; | 166 | config->focus_follows_mouse = true; |