Conf: section 'selbar' in section 'bar'
This commit is contained in:
20
src/config.c
20
src/config.c
@@ -176,13 +176,14 @@ conf_misc_section(char *src)
|
|||||||
void
|
void
|
||||||
conf_bar_section(char *src)
|
conf_bar_section(char *src)
|
||||||
{
|
{
|
||||||
|
char *tmp;
|
||||||
|
|
||||||
cfg_set_sauv(src);
|
cfg_set_sauv(src);
|
||||||
|
|
||||||
conf.border.bar = get_opt(src, "false", "border").bool;
|
conf.border.bar = get_opt(src, "false", "border").bool;
|
||||||
conf.bars.height = get_opt(src, "-1", "height").num;
|
conf.bars.height = get_opt(src, "-1", "height").num;
|
||||||
conf.colors.bar = getcolor(get_opt(src, "#000000", "bg").str);
|
conf.colors.bar = getcolor(get_opt(src, "#000000", "bg").str);
|
||||||
conf.colors.text = get_opt(src, "#ffffff", "fg").str;
|
conf.colors.text = get_opt(src, "#ffffff", "fg").str;
|
||||||
conf.bars.selbar = get_opt(src, "false", "selbar").bool;
|
|
||||||
|
|
||||||
if((conf.bars.nmouse = get_size_sec(src, "mouse")))
|
if((conf.bars.nmouse = get_size_sec(src, "mouse")))
|
||||||
{
|
{
|
||||||
@@ -190,6 +191,23 @@ conf_bar_section(char *src)
|
|||||||
mouse_section(conf.bars.mouse, src, conf.bars.nmouse);
|
mouse_section(conf.bars.mouse, src, conf.bars.nmouse);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Selbar part {{ */
|
||||||
|
tmp = get_sec(src, "selbar");
|
||||||
|
cfg_set_sauv(tmp);
|
||||||
|
|
||||||
|
conf.bars.selbar = tmp ? True : False;
|
||||||
|
|
||||||
|
conf.selbar.bg = getcolor(get_opt(tmp, "#000000", "bg").str);
|
||||||
|
conf.selbar.fg = get_opt(tmp, "#ffffff", "fg").str;
|
||||||
|
|
||||||
|
/* Multi mouse section */
|
||||||
|
if((conf.selbar.nmouse = get_size_sec(tmp, "mouse")))
|
||||||
|
{
|
||||||
|
conf.selbar.mouse = emalloc(conf.selbar.nmouse, sizeof(MouseBinding));
|
||||||
|
mouse_section(conf.selbar.mouse, tmp, conf.selbar.nmouse);
|
||||||
|
}
|
||||||
|
/* }} */
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -96,6 +96,15 @@ buttonpress(XButtonEvent *ev)
|
|||||||
if(conf.bars.mouse[j].func)
|
if(conf.bars.mouse[j].func)
|
||||||
conf.bars.mouse[j].func(conf.bars.mouse[j].cmd);
|
conf.bars.mouse[j].func(conf.bars.mouse[j].cmd);
|
||||||
|
|
||||||
|
/* Selbar */
|
||||||
|
if(ev->window == infobar[selscreen].selbar->win)
|
||||||
|
for(i = 0; i < conf.selbar.nmouse; ++i)
|
||||||
|
if(conf.selbar.mouse[i].tag == seltag[conf.selbar.mouse[i].screen]
|
||||||
|
|| conf.selbar.mouse[i].tag < 0)
|
||||||
|
if(ev->button == conf.selbar.mouse[i].button)
|
||||||
|
if(conf.selbar.mouse[i].func)
|
||||||
|
conf.selbar.mouse[i].func(conf.selbar.mouse[i].cmd);
|
||||||
|
|
||||||
/* Tags */
|
/* Tags */
|
||||||
for(i = 1; i < conf.ntag[selscreen] + 1; ++i)
|
for(i = 1; i < conf.ntag[selscreen] + 1; ++i)
|
||||||
if(ev->window == infobar[selscreen].tags[i]->win)
|
if(ev->window == infobar[selscreen].tags[i]->win)
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ infobar_init(void)
|
|||||||
: infobar[sc].layout_button->geo.x + infobar[sc].layout_button->geo.width + PAD / 2), 1,
|
: infobar[sc].layout_button->geo.x + infobar[sc].layout_button->geo.width + PAD / 2), 1,
|
||||||
(sel) ? textw(sel->title) + PAD : 1,
|
(sel) ? textw(sel->title) + PAD : 1,
|
||||||
infobar[sc].geo.height - 2,
|
infobar[sc].geo.height - 2,
|
||||||
conf.colors.bar, conf.colors.text, False, False, False);
|
conf.selbar.bg, conf.selbar.fg, False, False, False);
|
||||||
|
|
||||||
/* Map/Refresh all */
|
/* Map/Refresh all */
|
||||||
barwin_map(infobar[sc].bar);
|
barwin_map(infobar[sc].bar);
|
||||||
|
|||||||
@@ -373,6 +373,13 @@ typedef struct
|
|||||||
Bool selbar;
|
Bool selbar;
|
||||||
} bars;
|
} bars;
|
||||||
struct
|
struct
|
||||||
|
{
|
||||||
|
char *fg;
|
||||||
|
uint bg;
|
||||||
|
MouseBinding *mouse;
|
||||||
|
int nmouse;
|
||||||
|
} selbar;
|
||||||
|
struct
|
||||||
{
|
{
|
||||||
char *background_command;
|
char *background_command;
|
||||||
MouseBinding *mouse;
|
MouseBinding *mouse;
|
||||||
|
|||||||
@@ -125,6 +125,7 @@ quit(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
IFREE(conf.bars.mouse);
|
IFREE(conf.bars.mouse);
|
||||||
|
IFREE(conf.selbar.mouse);
|
||||||
IFREE(conf.titlebar.button);
|
IFREE(conf.titlebar.button);
|
||||||
IFREE(conf.client.mouse);
|
IFREE(conf.client.mouse);
|
||||||
IFREE(conf.root.mouse);
|
IFREE(conf.root.mouse);
|
||||||
|
|||||||
12
wmfsrc.in
12
wmfsrc.in
@@ -18,7 +18,17 @@
|
|||||||
bg = "#191919"
|
bg = "#191919"
|
||||||
fg = "#D4D4D4"
|
fg = "#D4D4D4"
|
||||||
border = true
|
border = true
|
||||||
selbar = false
|
# selbar = false #not worked now, see section [selbar]
|
||||||
|
|
||||||
|
# Remove this section to disable the selbar.
|
||||||
|
[selbar]
|
||||||
|
bg = "#191919"
|
||||||
|
fg = "#D4D4ff"
|
||||||
|
|
||||||
|
[mouse] button = "4" func = "client_next" [/mouse]
|
||||||
|
[mouse] button = "5" func = "client_prev" [/mouse]
|
||||||
|
[/selbar]
|
||||||
|
|
||||||
[/bar]
|
[/bar]
|
||||||
|
|
||||||
[layouts]
|
[layouts]
|
||||||
|
|||||||
Reference in New Issue
Block a user