From 5d9ef8b5d5667bc1fa5bdafb6437bb8acb942266 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Wed, 2 Jan 2008 17:10:32 +0100 Subject: [PATCH] new uicb: tag_create --- tag.c | 18 ++++++++++++++++++ tag.h | 1 + uicb.c | 1 + 3 files changed, 20 insertions(+) diff --git a/tag.c b/tag.c index 077cfc74..4219c2e6 100644 --- a/tag.c +++ b/tag.c @@ -404,4 +404,22 @@ uicb_tag_viewprev(int screen, char *arg __attribute__ ((unused))) p_delete(&curtags); ewmh_update_net_current_desktop(get_phys_screen(screen)); } + +void +uicb_tag_create(int screen, char *arg) +{ + Tag *last_tag, *tag; + + if(!a_strlen(arg)) + return; + + for(last_tag = globalconf.screens[screen].tags; last_tag && last_tag->next; last_tag = last_tag->next); + last_tag->next = tag = p_new(Tag, 1); + tag->name = a_strdup(arg); + tag->layout = globalconf.screens[screen].layouts; + tag->mwfact = 0.5; + tag->nmaster = 1; + tag->ncol = 1; +} + // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80 diff --git a/tag.h b/tag.h index 6a53fe7e..9c964a7c 100644 --- a/tag.h +++ b/tag.h @@ -43,6 +43,7 @@ Uicb uicb_tag_view; Uicb uicb_tag_prev_selected; Uicb uicb_tag_viewnext; Uicb uicb_tag_viewprev; +Uicb uicb_tag_create; #endif // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80 diff --git a/uicb.c b/uicb.c index 6cb06615..50b9fd76 100644 --- a/uicb.c +++ b/uicb.c @@ -54,6 +54,7 @@ const NameFuncLink UicbList[] = {"tag_viewprev_selected", uicb_tag_prev_selected}, {"tag_viewprev", uicb_tag_viewprev}, {"tag_viewnext", uicb_tag_viewnext}, + {"tag_create", uicb_tag_create}, /* layout.c */ {"tag_setlayout", uicb_tag_setlayout}, {"client_focusnext", uicb_client_focusnext},