Browse Source

Set at least one tag on screen where there is no one, use no screen option in [tag] sections in default config (= screen = -1, tag on each screen)

Martin Duquesnoy 12 years ago
parent
commit
682bbeea89
2 changed files with 19 additions and 9 deletions
  1. 7 2
      src/config.c
  2. 12 7
      wmfsrc

+ 7 - 2
src/config.c

@@ -24,8 +24,8 @@ config_mouse_section(struct mbhead *mousebinds, struct conf_sec **sec)
      {
           m = xcalloc(1, sizeof(struct mousebind));
 
-          m->button   = fetch_opt_first(sec[i], "1", "button").num;
-          m->func     = uicb_name_func(fetch_opt_first(sec[i], "", "func").str);
+          m->button = fetch_opt_first(sec[i], "1", "button").num;
+          m->func   = uicb_name_func(fetch_opt_first(sec[i], "", "func").str);
 
           if((p = fetch_opt_first(sec[i], "", "cmd").str))
                m->cmd = xstrdup(p);
@@ -161,6 +161,11 @@ config_tag(void)
                     tag_new(s, name);
      }
 
+     /* If no tag at all on a screen, add one anyway */
+     SLIST_FOREACH(s, &W->h.screen, next)
+          if(TAILQ_EMPTY(&s->tags))
+               tag_new(s, "tag");
+
      free(ks);
 }
 

+ 12 - 7
wmfsrc

@@ -71,13 +71,18 @@
 
 [tags]
 
-  [tag] screen = 0 name = "1" [/tag]
-  [tag] screen = 0 name = "2" [/tag]
-  [tag] screen = 0 name = "3" [/tag]
-  [tag] screen = 0 name = "4" [/tag]
-  [tag] screen = 0 name = "5" [/tag]
-  [tag] screen = 0 name = "6" [/tag]
-  [tag] screen = 0 name = "7" [/tag]
+  # Use no screen option or screen = -1 to set tag on each screen
+  [tag]
+      screen = -1
+      name = "1"
+  [/tag]
+
+  [tag] name = "2" [/tag]
+  [tag] name = "3" [/tag]
+  [tag] name = "4" [/tag]
+  [tag] name = "5" [/tag]
+  [tag] name = "6" [/tag]
+  [tag] name = "7" [/tag]
 
   # Mousebinds associated to Tags element button
   [mouse] button = "1" func = "tag_click" [/mouse]