diff options
Diffstat (limited to 'swaybar')
-rw-r--r-- | swaybar/main.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/swaybar/main.c b/swaybar/main.c index 5b8ba45d..88cd1dbe 100644 --- a/swaybar/main.c +++ b/swaybar/main.c | |||
@@ -186,6 +186,15 @@ uint32_t parse_position(const char *position) { | |||
186 | } | 186 | } |
187 | } | 187 | } |
188 | 188 | ||
189 | char *parse_font(const char *font) { | ||
190 | char *new_font = NULL; | ||
191 | if (strncmp("pango:", font, 6) == 0) { | ||
192 | new_font = strdup(font + 6); | ||
193 | } | ||
194 | |||
195 | return new_font; | ||
196 | } | ||
197 | |||
189 | static int margin = 3; | 198 | static int margin = 3; |
190 | static const int ws_hor_padding = 5; | 199 | static const int ws_hor_padding = 5; |
191 | static double ws_ver_padding = 1.5; | 200 | static double ws_ver_padding = 1.5; |
@@ -232,6 +241,10 @@ void bar_ipc_init(int outputi, const char *bar_id) { | |||
232 | desktop_shell_set_panel_position(registry->desktop_shell, parse_position(json_object_get_string(position))); | 241 | desktop_shell_set_panel_position(registry->desktop_shell, parse_position(json_object_get_string(position))); |
233 | } | 242 | } |
234 | 243 | ||
244 | if (font) { | ||
245 | window->font = parse_font(json_object_get_string(font)); | ||
246 | } | ||
247 | |||
235 | if (bar_height) { | 248 | if (bar_height) { |
236 | int width, height; | 249 | int width, height; |
237 | get_text_size(window, &width, &height, "Test string for measuring purposes"); | 250 | get_text_size(window, &width, &height, "Test string for measuring purposes"); |