- /* Taskbar */
- else if (strcmp (key, "taskbar_mode") == 0) {
- if (strcmp (value, "single_desktop") == 0) panel_mode = SINGLE_DESKTOP;
- else panel_mode = MULTI_DESKTOP;
- }
- else if (strcmp (key, "taskbar_padding") == 0) {
- extract_values(value, &value1, &value2, &value3);
- panel_config->g_taskbar.paddingxlr = panel_config->g_taskbar.paddingx = atoi (value1);
- if (value2) panel_config->g_taskbar.paddingy = atoi (value2);
- if (value3) panel_config->g_taskbar.paddingx = atoi (value3);
- }
- else if (strcmp (key, "taskbar_background_id") == 0) {
- int id = atoi (value);
- Area *a = g_slist_nth_data(list_back, id);
- memcpy(&panel_config->g_taskbar.pix.back, &a->pix.back, sizeof(Color));
- memcpy(&panel_config->g_taskbar.pix.border, &a->pix.border, sizeof(Border));
- }
-
- /* Task */
- else if (strcmp (key, "task_text") == 0)
- panel_config->g_task.text = atoi (value);
- else if (strcmp (key, "task_icon") == 0)
- panel_config->g_task.icon = atoi (value);
- else if (strcmp (key, "task_centered") == 0)
- panel_config->g_task.centered = atoi (value);
- else if (strcmp (key, "task_width") == 0)
- panel_config->g_task.maximum_width = atoi (value);
- else if (strcmp (key, "task_padding") == 0) {
- extract_values(value, &value1, &value2, &value3);
- panel_config->g_task.area.paddingxlr = panel_config->g_task.area.paddingx = atoi (value1);
- if (value2) panel_config->g_task.area.paddingy = atoi (value2);
- if (value3) panel_config->g_task.area.paddingx = atoi (value3);
- }
- else if (strcmp (key, "task_font") == 0) {
- if (save_file_config) old_task_font = strdup (value);
- if (panel_config->g_task.font_desc) pango_font_description_free(panel_config->g_task.font_desc);
- panel_config->g_task.font_desc = pango_font_description_from_string (value);
- }
- else if (strcmp (key, "task_font_color") == 0) {
- extract_values(value, &value1, &value2, &value3);
- get_color (value1, panel_config->g_task.font.color);
- if (value2) panel_config->g_task.font.alpha = (atoi (value2) / 100.0);
- else panel_config->g_task.font.alpha = 0.1;
- }
- else if (strcmp (key, "task_active_font_color") == 0) {
- extract_values(value, &value1, &value2, &value3);
- get_color (value1, panel_config->g_task.font_active.color);
- if (value2) panel_config->g_task.font_active.alpha = (atoi (value2) / 100.0);
- else panel_config->g_task.font_active.alpha = 0.1;
- }
- else if (strcmp (key, "task_background_id") == 0) {
- int id = atoi (value);
- Area *a = g_slist_nth_data(list_back, id);
- memcpy(&panel_config->g_task.area.pix.back, &a->pix.back, sizeof(Color));
- memcpy(&panel_config->g_task.area.pix.border, &a->pix.border, sizeof(Border));
- }
- else if (strcmp (key, "task_active_background_id") == 0) {
- int id = atoi (value);
- Area *a = g_slist_nth_data(list_back, id);
- memcpy(&panel_config->g_task.area.pix_active.back, &a->pix.back, sizeof(Color));
- memcpy(&panel_config->g_task.area.pix_active.border, &a->pix.border, sizeof(Border));
- }
-
- /* Systray */
- else if (strcmp (key, "systray_padding") == 0) {
- extract_values(value, &value1, &value2, &value3);
- systray.area.paddingxlr = systray.area.paddingx = atoi (value1);
- if (value2) systray.area.paddingy = atoi (value2);
- if (value3) systray.area.paddingx = atoi (value3);
- systray.area.on_screen = 1;
- }
- else if (strcmp (key, "systray_background_id") == 0) {
- int id = atoi (value);
- Area *a = g_slist_nth_data(list_back, id);
- memcpy(&systray.area.pix.back, &a->pix.back, sizeof(Color));
- memcpy(&systray.area.pix.border, &a->pix.border, sizeof(Border));
- }
-
- /* Mouse actions */
- else if (strcmp (key, "mouse_middle") == 0)
- get_action (value, &mouse_middle);
- else if (strcmp (key, "mouse_right") == 0)
- get_action (value, &mouse_right);
- else if (strcmp (key, "mouse_scroll_up") == 0)
- get_action (value, &mouse_scroll_up);
- else if (strcmp (key, "mouse_scroll_down") == 0)
- get_action (value, &mouse_scroll_down);
-
-
- /* Read tint-0.6 config for backward compatibility */
- else if (strcmp (key, "panel_mode") == 0) {
- if (strcmp (value, "single_desktop") == 0) panel_mode = SINGLE_DESKTOP;
- else panel_mode = MULTI_DESKTOP;
- }
- else if (strcmp (key, "panel_rounded") == 0) {
- Area *a = calloc(1, sizeof(Area));
- a->pix.border.rounded = atoi (value);
- list_back = g_slist_append(list_back, a);
- }
- else if (strcmp (key, "panel_border_width") == 0) {
- Area *a = g_slist_last(list_back)->data;
- a->pix.border.width = atoi (value);
- }
- else if (strcmp (key, "panel_background_color") == 0) {
- Area *a = g_slist_last(list_back)->data;
- extract_values(value, &value1, &value2, &value3);
- get_color (value1, a->pix.back.color);
- if (value2) a->pix.back.alpha = (atoi (value2) / 100.0);
- else a->pix.back.alpha = 0.5;
- }
- else if (strcmp (key, "panel_border_color") == 0) {
- Area *a = g_slist_last(list_back)->data;
- extract_values(value, &value1, &value2, &value3);
- get_color (value1, a->pix.border.color);
- if (value2) a->pix.border.alpha = (atoi (value2) / 100.0);
- else a->pix.border.alpha = 0.5;
- }
- else if (strcmp (key, "task_text_centered") == 0)
- panel_config->g_task.centered = atoi (value);
- else if (strcmp (key, "task_margin") == 0) {
- panel_config->g_taskbar.paddingxlr = 0;
- panel_config->g_taskbar.paddingx = atoi (value);
- }
- else if (strcmp (key, "task_icon_size") == 0)
- old_task_icon_size = atoi (value);
- else if (strcmp (key, "task_rounded") == 0) {
- area_task = calloc(1, sizeof(Area));
- area_task->pix.border.rounded = atoi (value);
- list_back = g_slist_append(list_back, area_task);
-
- area_task_active = calloc(1, sizeof(Area));
- area_task_active->pix.border.rounded = atoi (value);
- list_back = g_slist_append(list_back, area_task_active);
- }
- else if (strcmp (key, "task_background_color") == 0) {
- extract_values(value, &value1, &value2, &value3);
- get_color (value1, area_task->pix.back.color);
- if (value2) area_task->pix.back.alpha = (atoi (value2) / 100.0);
- else area_task->pix.back.alpha = 0.5;
- }
- else if (strcmp (key, "task_active_background_color") == 0) {
- extract_values(value, &value1, &value2, &value3);
- get_color (value1, area_task_active->pix.back.color);
- if (value2) area_task_active->pix.back.alpha = (atoi (value2) / 100.0);
- else area_task_active->pix.back.alpha = 0.5;
- }
- else if (strcmp (key, "task_border_width") == 0) {
- area_task->pix.border.width = atoi (value);
- area_task_active->pix.border.width = atoi (value);
- }
- else if (strcmp (key, "task_border_color") == 0) {
- extract_values(value, &value1, &value2, &value3);
- get_color (value1, area_task->pix.border.color);
- if (value2) area_task->pix.border.alpha = (atoi (value2) / 100.0);
- else area_task->pix.border.alpha = 0.5;
- }
- else if (strcmp (key, "task_active_border_color") == 0) {
- extract_values(value, &value1, &value2, &value3);
- get_color (value1, area_task_active->pix.border.color);
- if (value2) area_task_active->pix.border.alpha = (atoi (value2) / 100.0);
- else area_task_active->pix.border.alpha = 0.5;
- }
-
- else
- fprintf(stderr, "tint2 : invalid option \"%s\", correct your config file\n", key);
-
- if (value1) free (value1);
- if (value2) free (value2);
- if (value3) free (value3);
+ /* Taskbar */
+ else if (strcmp (key, "taskbar_mode") == 0) {
+ if (strcmp (value, "multi_desktop") == 0) panel_mode = MULTI_DESKTOP;
+ else panel_mode = SINGLE_DESKTOP;
+ }
+ else if (strcmp (key, "taskbar_padding") == 0) {
+ extract_values(value, &value1, &value2, &value3);
+ panel_config.g_taskbar.paddingxlr = panel_config.g_taskbar.paddingx = atoi (value1);
+ if (value2) panel_config.g_taskbar.paddingy = atoi (value2);
+ if (value3) panel_config.g_taskbar.paddingx = atoi (value3);
+ }
+ else if (strcmp (key, "taskbar_background_id") == 0) {
+ int id = atoi (value);
+ Area *a = g_slist_nth_data(list_back, id);
+ memcpy(&panel_config.g_taskbar.pix.back, &a->pix.back, sizeof(Color));
+ memcpy(&panel_config.g_taskbar.pix.border, &a->pix.border, sizeof(Border));
+ }
+ else if (strcmp (key, "taskbar_active_background_id") == 0) {
+ int id = atoi (value);
+ Area *a = g_slist_nth_data(list_back, id);
+ memcpy(&panel_config.g_taskbar.pix_active.back, &a->pix.back, sizeof(Color));
+ memcpy(&panel_config.g_taskbar.pix_active.border, &a->pix.border, sizeof(Border));
+ panel_config.g_taskbar.use_active = 1;
+ }
+
+ /* Task */
+ else if (strcmp (key, "task_text") == 0)
+ panel_config.g_task.text = atoi (value);
+ else if (strcmp (key, "task_icon") == 0)
+ panel_config.g_task.icon = atoi (value);
+ else if (strcmp (key, "task_centered") == 0)
+ panel_config.g_task.centered = atoi (value);
+ else if (strcmp (key, "task_width") == 0) {
+ // old parameter : just for backward compatibility
+ panel_config.g_task.maximum_width = atoi (value);
+ panel_config.g_task.maximum_height = 30;
+ }
+ else if (strcmp (key, "task_maximum_size") == 0) {
+ extract_values(value, &value1, &value2, &value3);
+ panel_config.g_task.maximum_width = atoi (value1);
+ panel_config.g_task.maximum_height = 30;
+ if (value2)
+ panel_config.g_task.maximum_height = atoi (value2);
+ }
+ else if (strcmp (key, "task_padding") == 0) {
+ extract_values(value, &value1, &value2, &value3);
+ panel_config.g_task.area.paddingxlr = panel_config.g_task.area.paddingx = atoi (value1);
+ if (value2) panel_config.g_task.area.paddingy = atoi (value2);
+ if (value3) panel_config.g_task.area.paddingx = atoi (value3);
+ }
+ else if (strcmp (key, "task_font") == 0) {
+ if (save_file_config) old_task_font = strdup (value);
+ if (panel_config.g_task.font_desc) pango_font_description_free(panel_config.g_task.font_desc);
+ panel_config.g_task.font_desc = pango_font_description_from_string (value);
+ }
+ else if (strcmp (key, "task_font_color") == 0) {
+ extract_values(value, &value1, &value2, &value3);
+ get_color (value1, panel_config.g_task.font.color);
+ if (value2) panel_config.g_task.font.alpha = (atoi (value2) / 100.0);
+ else panel_config.g_task.font.alpha = 0.1;
+ }
+ else if (strcmp (key, "task_active_font_color") == 0) {
+ extract_values(value, &value1, &value2, &value3);
+ get_color (value1, panel_config.g_task.font_active.color);
+ if (value2) panel_config.g_task.font_active.alpha = (atoi (value2) / 100.0);
+ else panel_config.g_task.font_active.alpha = 0.1;
+ }
+ else if (strcmp (key, "task_icon_asb") == 0) {
+ extract_values(value, &value1, &value2, &value3);
+ panel_config.g_task.alpha = atoi(value1);
+ panel_config.g_task.saturation = atoi(value2);
+ panel_config.g_task.brightness = atoi(value3);
+ }
+ else if (strcmp (key, "task_active_icon_asb") == 0) {
+ extract_values(value, &value1, &value2, &value3);
+ panel_config.g_task.alpha_active = atoi(value1);
+ panel_config.g_task.saturation_active = atoi(value2);
+ panel_config.g_task.brightness_active = atoi(value3);
+ }
+ else if (strcmp (key, "task_background_id") == 0) {
+ int id = atoi (value);
+ Area *a = g_slist_nth_data(list_back, id);
+ memcpy(&panel_config.g_task.area.pix.back, &a->pix.back, sizeof(Color));
+ memcpy(&panel_config.g_task.area.pix.border, &a->pix.border, sizeof(Border));
+ }
+ else if (strcmp (key, "task_active_background_id") == 0) {
+ int id = atoi (value);
+ Area *a = g_slist_nth_data(list_back, id);
+ memcpy(&panel_config.g_task.area.pix_active.back, &a->pix.back, sizeof(Color));
+ memcpy(&panel_config.g_task.area.pix_active.border, &a->pix.border, sizeof(Border));
+ }
+
+ /* Systray */
+ else if (strcmp (key, "systray_padding") == 0) {
+ extract_values(value, &value1, &value2, &value3);
+ systray.area.paddingxlr = systray.area.paddingx = atoi (value1);
+ if (value2) systray.area.paddingy = atoi (value2);
+ if (value3) systray.area.paddingx = atoi (value3);
+ systray.area.on_screen = 1;
+ }
+ else if (strcmp (key, "systray_background_id") == 0) {
+ int id = atoi (value);
+ Area *a = g_slist_nth_data(list_back, id);
+ memcpy(&systray.area.pix.back, &a->pix.back, sizeof(Color));
+ memcpy(&systray.area.pix.border, &a->pix.border, sizeof(Border));
+ }
+ else if (strcmp(key, "systray_sort") == 0) {
+ if (strcmp(value, "descending") == 0)
+ systray.sort = -1;
+ else if (strcmp(value, "ascending") == 0)
+ systray.sort = 1;
+ else if (strcmp(value, "left2right") == 0)
+ systray.sort = 2;
+ else if (strcmp(value, "right2left") == 0)
+ systray.sort = 3;
+ }
+
+ /* Tooltip */
+ else if (strcmp (key, "tooltip") == 0)
+ g_tooltip.enabled = atoi(value);
+ else if (strcmp (key, "tooltip_show_timeout") == 0) {
+ double timeout = atof(value);
+ int sec = (int)timeout;
+ int usec = (timeout-sec)*1e6;
+ g_tooltip.show_timeout.it_value = (struct timeval){.tv_sec=sec, .tv_usec=usec};
+ }
+ else if (strcmp (key, "tooltip_hide_timeout") == 0) {
+ double timeout = atof(value);
+ int sec = (int)timeout;
+ int usec = (timeout-sec)*1e6;
+ g_tooltip.hide_timeout.it_value = (struct timeval){.tv_sec=sec, .tv_usec=usec};
+ }
+ else if (strcmp (key, "tooltip_padding") == 0) {
+ extract_values(value, &value1, &value2, &value3);
+ if (value1) g_tooltip.paddingx = atoi(value1);
+ if (value2) g_tooltip.paddingy = atoi(value2);
+ }
+ else if (strcmp (key, "tooltip_background_id") == 0) {
+ int id = atoi (value);
+ Area *a = g_slist_nth_data(list_back, id);
+ memcpy(&g_tooltip.background_color, &a->pix.back, sizeof(Color));
+ memcpy(&g_tooltip.border, &a->pix.border, sizeof(Border));
+ }
+ else if (strcmp (key, "tooltip_font_color") == 0) {
+ extract_values(value, &value1, &value2, &value3);
+ get_color(value1, g_tooltip.font_color.color);
+ if (value2) g_tooltip.font_color.alpha = (atoi (value2) / 100.0);
+ else g_tooltip.font_color.alpha = 0.1;
+ }
+ else if (strcmp (key, "tooltip_font") == 0) {
+ if (g_tooltip.font_desc) pango_font_description_free(g_tooltip.font_desc);
+ g_tooltip.font_desc = pango_font_description_from_string(value);
+ }
+
+ /* Mouse actions */
+ else if (strcmp (key, "mouse_middle") == 0)
+ get_action (value, &mouse_middle);
+ else if (strcmp (key, "mouse_right") == 0)
+ get_action (value, &mouse_right);
+ else if (strcmp (key, "mouse_scroll_up") == 0)
+ get_action (value, &mouse_scroll_up);
+ else if (strcmp (key, "mouse_scroll_down") == 0)
+ get_action (value, &mouse_scroll_down);
+
+
+ /* Read tint-0.6 config for backward compatibility */
+ else if (strcmp (key, "panel_mode") == 0) {
+ save_file_config = 1;
+ if (strcmp (value, "single_desktop") == 0) panel_mode = SINGLE_DESKTOP;
+ else panel_mode = MULTI_DESKTOP;
+ }
+ else if (strcmp (key, "panel_rounded") == 0) {
+ Area *a = calloc(1, sizeof(Area));
+ a->pix.border.rounded = atoi (value);
+ list_back = g_slist_append(list_back, a);
+ }
+ else if (strcmp (key, "panel_border_width") == 0) {
+ Area *a = g_slist_last(list_back)->data;
+ a->pix.border.width = atoi (value);
+ }
+ else if (strcmp (key, "panel_background_color") == 0) {
+ Area *a = g_slist_last(list_back)->data;
+ extract_values(value, &value1, &value2, &value3);
+ get_color (value1, a->pix.back.color);
+ if (value2) a->pix.back.alpha = (atoi (value2) / 100.0);
+ else a->pix.back.alpha = 0.5;
+ }
+ else if (strcmp (key, "panel_border_color") == 0) {
+ Area *a = g_slist_last(list_back)->data;
+ extract_values(value, &value1, &value2, &value3);
+ get_color (value1, a->pix.border.color);
+ if (value2) a->pix.border.alpha = (atoi (value2) / 100.0);
+ else a->pix.border.alpha = 0.5;
+ }
+ else if (strcmp (key, "task_text_centered") == 0)
+ panel_config.g_task.centered = atoi (value);
+ else if (strcmp (key, "task_margin") == 0) {
+ panel_config.g_taskbar.paddingxlr = 0;
+ panel_config.g_taskbar.paddingx = atoi (value);
+ }
+ else if (strcmp (key, "task_icon_size") == 0)
+ old_task_icon_size = atoi (value);
+ else if (strcmp (key, "task_rounded") == 0) {
+ area_task = calloc(1, sizeof(Area));
+ area_task->pix.border.rounded = atoi (value);
+ list_back = g_slist_append(list_back, area_task);
+
+ area_task_active = calloc(1, sizeof(Area));
+ area_task_active->pix.border.rounded = atoi (value);
+ list_back = g_slist_append(list_back, area_task_active);
+ }
+ else if (strcmp (key, "task_background_color") == 0) {
+ extract_values(value, &value1, &value2, &value3);
+ get_color (value1, area_task->pix.back.color);
+ if (value2) area_task->pix.back.alpha = (atoi (value2) / 100.0);
+ else area_task->pix.back.alpha = 0.5;
+ }
+ else if (strcmp (key, "task_active_background_color") == 0) {
+ extract_values(value, &value1, &value2, &value3);
+ get_color (value1, area_task_active->pix.back.color);
+ if (value2) area_task_active->pix.back.alpha = (atoi (value2) / 100.0);
+ else area_task_active->pix.back.alpha = 0.5;
+ }
+ else if (strcmp (key, "task_border_width") == 0) {
+ area_task->pix.border.width = atoi (value);
+ area_task_active->pix.border.width = atoi (value);
+ }
+ else if (strcmp (key, "task_border_color") == 0) {
+ extract_values(value, &value1, &value2, &value3);
+ get_color (value1, area_task->pix.border.color);
+ if (value2) area_task->pix.border.alpha = (atoi (value2) / 100.0);
+ else area_task->pix.border.alpha = 0.5;
+ }
+ else if (strcmp (key, "task_active_border_color") == 0) {
+ extract_values(value, &value1, &value2, &value3);
+ get_color (value1, area_task_active->pix.border.color);
+ if (value2) area_task_active->pix.border.alpha = (atoi (value2) / 100.0);
+ else area_task_active->pix.border.alpha = 0.5;
+ }
+
+ else
+ fprintf(stderr, "tint2 : invalid option \"%s\", correct your config file\n", key);
+
+ if (value1) free (value1);
+ if (value2) free (value2);
+ if (value3) free (value3);