]> Dogcows Code - chaz/tint2/blobdiff - src/config.c
added taskbar_active_background_id to change current desktop background
[chaz/tint2] / src / config.c
index 0a1d13a18bf66c8e0eeee5e42c7d6d3136f2ba19..fce3ff98ea1cbb7fd1521049f4639ee6bb514308 100644 (file)
@@ -48,6 +48,9 @@
 #include "battery.h"
 #endif
 
+// global path
+char *config_path = 0;
+char *thumbnail_path = 0;
 
 // --------------------------------------------------
 // backward compatibility
@@ -81,6 +84,8 @@ void init_config()
    list_back = g_slist_append(0, calloc(1, sizeof(Area)));
 
        panel_config = calloc(1, sizeof(Panel));
+       systray.sort = 1;
+
        // window manager's menu default value == false
        wm_menu = 0;
        max_tick_urgent = 7;
@@ -226,6 +231,12 @@ void get_action (char *event, int *action)
       *action = SHADE;
    else if (strcmp (event, "toggle_iconify") == 0)
       *action = TOGGLE_ICONIFY;
+   else if (strcmp (event, "maximize_restore") == 0)
+      *action = MAXIMIZE_RESTORE;
+   else if (strcmp (event, "desktop_left") == 0)
+      *action = DESKTOP_LEFT;
+   else if (strcmp (event, "desktop_right") == 0)
+      *action = DESKTOP_RIGHT;
 }
 
 
@@ -466,6 +477,13 @@ void add_entry (char *key, char *value)
       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)
@@ -509,6 +527,18 @@ void add_entry (char *key, char *value)
       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_hsb") == 0) {
+      extract_values(value, &value1, &value2, &value3);
+               panel_config->g_task.hue = atoi(value1);
+               panel_config->g_task.saturation = atoi(value2);
+               panel_config->g_task.brightness = atoi(value3);
+   }
+   else if (strcmp (key, "task_active_icon_hsb") == 0) {
+      extract_values(value, &value1, &value2, &value3);
+               panel_config->g_task.hue_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);
@@ -536,6 +566,12 @@ void add_entry (char *key, char *value)
       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, "desc") == 0)
+                       systray.sort = -1;
+               else
+                       systray.sort = 1;
+       }
 
    /* Mouse actions */
    else if (strcmp (key, "mouse_middle") == 0)
@@ -664,8 +700,10 @@ int parse_line (const char *line)
 void config_finish ()
 {
    if (panel_config->monitor > (server.nb_monitor-1)) {
-      fprintf(stderr, "tint2 exit : monitor %d not found.\n", panel_config->monitor+1);
-      exit(0);
+               // server.nb_monitor minimum value is 1 (see get_monitors_and_desktops())
+               // and panel_config->monitor is higher
+               fprintf(stderr, "warning : monitor not found. tint2 default to monitor 1.\n");
+               panel_config->monitor = 0;
    }
 
        // alloc panels
@@ -719,6 +757,7 @@ deb:
    path1 = g_build_filename (g_get_user_config_dir(), "tint2", "tint2rc", NULL);
    if (g_file_test (path1, G_FILE_TEST_EXISTS)) {
                i = config_read_file (path1);
+               config_path = strdup(path1);
                g_free(path1);
           return i;
        }
@@ -761,6 +800,7 @@ deb:
                g_free(path2);
 
                i = config_read_file (path1);
+               config_path = strdup(path1);
                g_free(path1);
                return i;
        }
This page took 0.026896 seconds and 4 git commands to generate.