Add an option to choose the default layout that will be used when adding

a new tag dynamically. Feature #71 requested by myself ^^
This commit is contained in:
Raphael Khaiat
2010-06-26 00:26:16 +02:00
parent e17f36f24f
commit 253d50762b
4 changed files with 20 additions and 17 deletions

View File

@@ -449,14 +449,6 @@ conf_tag_section(void)
struct conf_sec *sec, **tag, **mouse;
struct opt_type *opt;
/* If there is no tag in the conf or more than
* MAXTAG (36) print an error and create only one.
*/
Tag default_tag = { "WMFS", NULL, 0, 1,
0.50, 1, False, False, False, False, IB_Top,
layout_name_to_struct(conf.layout, "tile_right", conf.nlayout, layout_list),
0, NULL, 0 };
sec = fetch_section_first(NULL, "tags");
conf.tag_round = fetch_opt_first(sec, "false", "tag_round").bool;
@@ -469,6 +461,15 @@ conf_tag_section(void)
conf.tagautohide = fetch_opt_first(sec, "false", "autohide").bool;
conf.tagnamecount = fetch_opt_first(sec, "false", "name_count").bool;
conf.tagdefaultname = fetch_opt_first(sec, "new tag", "default_name").str;
conf.tagdefaultlayout = fetch_opt_first(sec, "tile_right", "default_layout").str;
/* If there is no tag in the conf or more than
* MAXTAG (36) print an error and create only one.
*/
Tag default_tag = { "WMFS", NULL, 0, 1,
0.50, 1, False, False, False, False, IB_Top,
layout_name_to_struct(conf.layout, conf.tagdefaultlayout, conf.nlayout, layout_list),
0, NULL, 0 };
/* Mouse button action on tag */
conf.mouse_tag_action[TagSel] =

View File

@@ -348,6 +348,7 @@ typedef struct
Bool tagautohide;
Bool tagnamecount;
char * tagdefaultname;
char * tagdefaultlayout;
uint pad;
int status_timing;
char *status_path;

View File

@@ -475,7 +475,7 @@ tag_new(int s, char *name)
char * displayedName;
Tag t = { NULL, NULL, 0, 0, 0.65, 1, False, False, False, False, IB_Top,
layout_name_to_struct(conf.layout, "tile_right", conf.nlayout, layout_list), 0, NULL, 0 };
layout_name_to_struct(conf.layout, conf.tagdefaultlayout, conf.nlayout, layout_list), 0, NULL, 0 };
if(conf.ntag[s] + 1 > MAXTAG)
{

View File

@@ -68,15 +68,16 @@
[/layouts]
[tags]
tag_round = false
occupied_bg = "#003366"
sel_fg = "#191919"
sel_bg = "#7E89A2"
urgent_bg = "#DD1111"
urgent_fg = "#000000"
tag_round = false
occupied_bg = "#003366"
sel_fg = "#191919"
sel_bg = "#7E89A2"
urgent_bg = "#DD1111"
urgent_fg = "#000000"
# If true, number of the tag will be used for name
name_count = false
default_name= "new tag" # default name for a new tag
name_count = false
default_name = "new tag" # default name for a new tag
default_layout = "tile_right"
# Border around the tag buttons.
border = true