コード例 #1
0
ファイル: config.c プロジェクト: Engil/wmfs
static void
config_client(void)
{
     struct conf_sec *sec, **mb;
     char *tmp;

     /* [client] */
     sec = fetch_section_first(NULL, "client");

     W->padding = fetch_opt_first(sec, "0", "padding").num;
     W->client_mod = modkey_keysym(fetch_opt_first(sec, "Super", "key_modifier").str);

     if(fetch_opt_first(sec, "0", "autofocus").boolean)
          W->flags |= WMFS_AUTOFOCUS;

     /* Get theme */
     tmp = fetch_opt_first(sec, "default", "theme").str;
     W->ctheme = name_to_theme(tmp);

     /* Get focus configuration */
     W->cfocus = 0;
     tmp = fetch_opt_first(sec, "enter", "focus").str;
     if(strstr(tmp, "enter"))
          W->cfocus |= CFOCUS_ENTER;
     if(strstr(tmp, "click"))
          W->cfocus |= CFOCUS_CLICK;

     /* [mouse] */
     /* for client frame AND titlebar */
     if((mb = fetch_section(sec, "mouse")))
     {
          config_mouse_section(&W->tmp_head.client, mb);
          free(mb);
     }
}
コード例 #2
0
ファイル: config.c プロジェクト: Engil/wmfs
static void
config_tag(void)
{
     struct screen *s;
     struct tag *t;
     size_t i, n;
     struct conf_sec *sec, **ks, **mb;
     char *name, *tmp;
     int screenid;

     /* [tags] */
     sec = fetch_section_first(NULL, "tags");
     ks = fetch_section(sec, "tag");
     n = fetch_section_count(ks);

     if (fetch_opt_first(sec, "1", "circular").boolean)
          W->flags |= WMFS_TAGCIRC;

     /* [mouse] */
     if((mb = fetch_section(sec, "mouse")))
     {
          config_mouse_section(&W->tmp_head.tag, mb);
          free(mb);
     }

     /* [tag] */
     for(i = 0; i < n; ++i)
     {
          name = fetch_opt_first(ks[i], "tag", "name").str;
          screenid = fetch_opt_first(ks[i], "-1", "screen").num;

          SLIST_FOREACH(s, &W->h.screen, next)
               if(screenid == s->id || screenid == -1)
               {
                    t = tag_new(s, name);

                    t->statusctx = status_new_ctx(NULL, NULL);
                    ISTRDUP(t->statusctx.status, fetch_opt_first(ks[i], "", "statusline").str);
                    if(t->statusctx.status)
                         status_parse(&t->statusctx);
               }
     }

     /* 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);
}
コード例 #3
0
ファイル: config.c プロジェクト: greglee/wmfs
static void
config_client(void)
{
     struct conf_sec *sec, **mb;
     char *tmp;

     /* [client] */
     sec = fetch_section_first(NULL, "client");

     W->client_mod = modkey_keysym(fetch_opt_first(sec, "Super", "key_modifier").str);
     tmp = fetch_opt_first(sec, "default", "theme").str;
     W->ctheme = name_to_theme(tmp);

     /* [mouse] */
     /* for client frame AND titlebar */
     if((mb = fetch_section(sec, "mouse")))
     {
          config_mouse_section(&W->tmp_head.client, mb);
          free(mb);
     }
}