diff --git a/src/config.c b/src/config.c index 89ea268..e452a08 100644 --- a/src/config.c +++ b/src/config.c @@ -98,6 +98,7 @@ const func_name_list_t func_list[] = {"clientlist", uicb_clientlist }, {"check_clist", uicb_checkclist }, {"toggle_tagautohide", uicb_toggle_tagautohide }, + {"toggle_tag_expose", uicb_tag_toggle_expose}, {NULL, NULL} }; @@ -501,6 +502,8 @@ conf_tag_section(void) conf.border.tag = fetch_opt_first(sec, "false", "border").bool; conf.tagautohide = fetch_opt_first(sec, "false", "autohide").bool; conf.tagnamecount = fetch_opt_first(sec, "false", "name_count").bool; + conf.tag_expose_name = fetch_opt_first(sec, "EXPOSE", "expose_name").str; + conf.expose_layout = fetch_opt_first(sec, "tile_grid_vertical", "expose_layout").str; def_tag = fetch_section_first(sec, "default_tag"); diff --git a/src/structs.h b/src/structs.h index 40e6cbd..49e9e00 100644 --- a/src/structs.h +++ b/src/structs.h @@ -499,6 +499,8 @@ typedef struct Bool layout_system; /* Switch: False, Menu: True. */ Bool layout_placement; /* Right (normal): False, Left: True. */ Bool keep_layout_geo; + char *tag_expose_name; + char *expose_layout; char *selected_layout_symbol; /* Number of... */ int nkeybind; diff --git a/src/tag.c b/src/tag.c index dfd1f36..7a95d30 100644 --- a/src/tag.c +++ b/src/tag.c @@ -734,3 +734,43 @@ uicb_tag_rename(uicb_t cmd) return; } + +void +uicb_tag_toggle_expose(uicb_t cmd) +{ + (void)cmd; + int i; + + screen_get_sel(); + + for(i = 1; i <= conf.ntag[selscreen]; i++) + { + if(strcmp(tags[selscreen][i].name, conf.tag_expose_name) == 0) + { + tag_set(sel->tag); + arrange(selscreen, True); + tag_delete(selscreen, i); + return; + } + } + + tag_new(selscreen, conf.tag_expose_name); + + for(i = 0; i < conf.nlayout; ++i) + { + if(strcmp(conf.expose_layout, conf.layout[i].type) == 0) + { + tags[selscreen][conf.ntag[selscreen]].layout = conf.layout[i]; + } + } + + for(i = 1; i < conf.ntag[selscreen]; ++i) + { + tags[selscreen][conf.ntag[selscreen]].tagad ^= TagFlag(i); + } + + arrange(selscreen, True); + tags[selscreen][conf.ntag[selscreen]].request_update = True; + + return; +} diff --git a/src/wmfs.h b/src/wmfs.h index be2f4de..d540757 100644 --- a/src/wmfs.h +++ b/src/wmfs.h @@ -300,6 +300,7 @@ void uicb_tag_del(uicb_t); void uicb_tag_rename(uicb_t cmd); void uicb_tag_last(uicb_t cmd); void uicb_tag_stay_last(uicb_t cmd); +void uicb_tag_toggle_expose(uicb_t cmd); /* screen.c */ int screen_count(void); diff --git a/wmfsrc b/wmfsrc index d59c257..da816bc 100644 --- a/wmfsrc +++ b/wmfsrc @@ -124,6 +124,9 @@ #default_name = "new tag" # deprecated, use [default_tag] instead #default_layout = "tile_right" # deprecated, use [default_tag] instead + expose_name = "EXPOSE" + expose_layout = "tile_left" + # Border around the tag buttons. border = true @@ -431,6 +434,8 @@ [key] mod = {"Super", "Shift"} key = "a" func = "client_screen_next" [/key] [key] mod = {"Super", "Shift"} key = "z" func = "client_screen_prev" [/key] + [key] mod = {"Alt"} key = "e" func = "toggle_tag_expose" [/key] + # unlisted fonctions that can be used in [key] func = "" # client_focus_{right, left, top, bottom} # client_ignore_tag # Toggle the client in ignore_tag (display the client on all tags)