Add urgent tag support, tags_urgent/fg/bg/statusline in conf
This commit is contained in:
parent
233be4dbc1
commit
a6aa4edbd7
@ -668,7 +668,7 @@ uicb_client_close(Uicb cmd)
|
||||
client_close(W->client);
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
client_get_sizeh(struct client *c)
|
||||
{
|
||||
long msize;
|
||||
|
||||
@ -32,6 +32,7 @@ void client_get_name(struct client *c);
|
||||
void client_close(struct client *c);
|
||||
void uicb_client_close(Uicb cmd);
|
||||
struct client *client_new(Window w, XWindowAttributes *wa, bool scan);
|
||||
void client_get_sizeh(struct client *c);
|
||||
bool client_winsize(struct client *c, struct geo *geo);
|
||||
bool client_moveresize(struct client *c, struct geo *g);
|
||||
void client_maximize(struct client *c);
|
||||
|
||||
@ -78,6 +78,8 @@ config_theme(void)
|
||||
t->tags_s.bg = color_atoh(fetch_opt_first(ks[i], "#CCCCCC", "tags_sel_bg").str);
|
||||
t->tags_o.fg = color_atoh(fetch_opt_first(ks[i], "#CCCCCC", "tags_occupied_fg").str);
|
||||
t->tags_o.bg = color_atoh(fetch_opt_first(ks[i], "#444444", "tags_occupied_bg").str);
|
||||
t->tags_u.fg = color_atoh(fetch_opt_first(ks[i], "#444444", "tags_urgent_fg").str);
|
||||
t->tags_u.bg = color_atoh(fetch_opt_first(ks[i], "#CC4444", "tags_urgent_bg").str);
|
||||
t->tags_border_col = color_atoh(fetch_opt_first(ks[i], "#888888", "tags_border_color").str);
|
||||
t->tags_border_width = fetch_opt_first(ks[i], "0", "tags_border_width").num;
|
||||
|
||||
@ -86,6 +88,7 @@ config_theme(void)
|
||||
t->tags_n_sl = status_new_ctx(NULL, t);
|
||||
t->tags_s_sl = status_new_ctx(NULL, t);
|
||||
t->tags_o_sl = status_new_ctx(NULL, t);
|
||||
t->tags_u_sl = status_new_ctx(NULL, t);
|
||||
|
||||
if((t->tags_n_sl.status = xstrdup(fetch_opt_first(ks[i], "", "tags_normal_statusline").str)))
|
||||
status_parse(&t->tags_n_sl);
|
||||
@ -93,6 +96,8 @@ config_theme(void)
|
||||
status_parse(&t->tags_s_sl);
|
||||
if((t->tags_o_sl.status = xstrdup(fetch_opt_first(ks[i], "", "tags_occupied_statusline").str)))
|
||||
status_parse(&t->tags_o_sl);
|
||||
if((t->tags_u_sl.status = xstrdup(fetch_opt_first(ks[i], "", "tags_urgent_statusline").str)))
|
||||
status_parse(&t->tags_u_sl);
|
||||
|
||||
/* Client / frame */
|
||||
t->client_n.fg = color_atoh(fetch_opt_first(ks[i], "#CCCCCC", "client_normal_fg").str);
|
||||
|
||||
23
src/event.c
23
src/event.c
@ -11,6 +11,7 @@
|
||||
#include "barwin.h"
|
||||
#include "screen.h"
|
||||
#include "systray.h"
|
||||
#include "infobar.h"
|
||||
|
||||
#define EVDPY(e) (e)->xany.display
|
||||
|
||||
@ -214,6 +215,7 @@ static void
|
||||
event_propertynotify(XEvent *e)
|
||||
{
|
||||
XPropertyEvent *ev = &e->xproperty;
|
||||
XWMHints *h;
|
||||
struct client *c;
|
||||
struct _systray *s;
|
||||
|
||||
@ -226,20 +228,23 @@ event_propertynotify(XEvent *e)
|
||||
{
|
||||
case XA_WM_TRANSIENT_FOR:
|
||||
break;
|
||||
case XA_WM_NORMAL_HINTS:
|
||||
/* client_get_size_hints(c); */
|
||||
break;
|
||||
case XA_WM_HINTS:
|
||||
/*
|
||||
XWMHints *h;
|
||||
|
||||
if((h = XGetWMHints(EVDPY, c->win)) && (h->flags & XUrgencyHint) && c != sel)
|
||||
case XA_WM_NORMAL_HINTS:
|
||||
client_get_sizeh(c);
|
||||
break;
|
||||
|
||||
case XA_WM_HINTS:
|
||||
if((h = XGetWMHints(EVDPY(e), c->win))
|
||||
&& (h->flags & XUrgencyHint)
|
||||
&& c->tag != W->screen->seltag)
|
||||
{
|
||||
client_urgent(c, True);
|
||||
c->tag->flags |= TAG_URGENT;
|
||||
infobar_elem_screen_update(c->screen, ElemTag);
|
||||
XFree(h);
|
||||
}
|
||||
*/
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
if(ev->atom == XA_WM_NAME || ev->atom == W->net_atom[net_wm_name])
|
||||
client_get_name(c);
|
||||
|
||||
@ -110,12 +110,20 @@ infobar_elem_tag_update(struct element *e)
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Normal tag */
|
||||
if(SLIST_EMPTY(&t->clients))
|
||||
{
|
||||
b->fg = e->infobar->theme->tags_n.fg;
|
||||
b->bg = e->infobar->theme->tags_n.bg;
|
||||
e->statusctx = &e->infobar->theme->tags_n_sl;
|
||||
}
|
||||
/* Urgent tag */
|
||||
else if(t->flags & TAG_URGENT)
|
||||
{
|
||||
b->fg = e->infobar->theme->tags_u.fg;
|
||||
b->bg = e->infobar->theme->tags_u.bg;
|
||||
e->statusctx = &e->infobar->theme->tags_u_sl;
|
||||
}
|
||||
/* Occupied tag */
|
||||
else
|
||||
{
|
||||
|
||||
@ -56,6 +56,9 @@ tag_screen(struct screen *s, struct tag *t)
|
||||
if(!SLIST_EMPTY(&t->clients) && !(W->flags & WMFS_SCAN))
|
||||
client_focus( client_tab_next(t->sel));
|
||||
|
||||
if(t->flags & TAG_URGENT)
|
||||
t->flags ^= TAG_URGENT;
|
||||
|
||||
infobar_elem_screen_update(s, ElemTag);
|
||||
|
||||
ewmh_update_wmfs_props();
|
||||
|
||||
@ -8,7 +8,6 @@
|
||||
|
||||
#include "wmfs.h"
|
||||
|
||||
|
||||
static inline struct tag*
|
||||
tag_gb_id(struct screen *s, int id)
|
||||
{
|
||||
@ -34,5 +33,4 @@ void uicb_tag_move_client_next(Uicb cmd);
|
||||
void uicb_tag_move_client_prev(Uicb cmd);
|
||||
void uicb_tag_click(Uicb cmd);
|
||||
|
||||
|
||||
#endif /* TAG_H */
|
||||
|
||||
@ -165,6 +165,7 @@ struct tag
|
||||
struct tag *prev;
|
||||
char *name;
|
||||
int id;
|
||||
#define TAG_URGENT 0x01
|
||||
Flags flags;
|
||||
SLIST_HEAD(, client) clients;
|
||||
TAILQ_HEAD(ssub, layout_set) sets;
|
||||
@ -245,8 +246,8 @@ struct theme
|
||||
int bars_width;
|
||||
|
||||
/* struct elements */
|
||||
struct colpair tags_n, tags_s, tags_o; /* normal / selected / occupied */
|
||||
struct status_ctx tags_n_sl, tags_s_sl, tags_o_sl; /* status line */
|
||||
struct colpair tags_n, tags_s, tags_o, tags_u; /* normal / selected / occupied */
|
||||
struct status_ctx tags_n_sl, tags_s_sl, tags_o_sl, tags_u_sl; /* status line */
|
||||
int tags_border_width;
|
||||
Color tags_border_col;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user