screen can now be specified in rules
This commit is contained in:
parent
0c5c5ce426
commit
f70424487e
|
@ -92,8 +92,9 @@ rules
|
|||
rule
|
||||
{
|
||||
name = "Gimp"
|
||||
tags = ""
|
||||
tags = "9"
|
||||
float = true
|
||||
screen = 0
|
||||
}
|
||||
rule
|
||||
{
|
||||
|
|
6
client.c
6
client.c
|
@ -258,7 +258,7 @@ loadprops(Client * c, int ntags)
|
|||
void
|
||||
client_manage(Window w, XWindowAttributes *wa, awesome_config *awesomeconf)
|
||||
{
|
||||
int i;
|
||||
int i, newscreen = -1;
|
||||
Client *c, *t = NULL;
|
||||
Window trans;
|
||||
Status rettrans;
|
||||
|
@ -344,7 +344,7 @@ client_manage(Window w, XWindowAttributes *wa, awesome_config *awesomeconf)
|
|||
|
||||
/* loadprops or apply rules if no props */
|
||||
if(!loadprops(c, awesomeconf->ntags))
|
||||
applyrules(c, awesomeconf);
|
||||
newscreen = applyrules(c, awesomeconf);
|
||||
|
||||
/* should be floating if transsient or fixed) */
|
||||
if(!c->isfloating)
|
||||
|
@ -363,6 +363,8 @@ client_manage(Window w, XWindowAttributes *wa, awesome_config *awesomeconf)
|
|||
|
||||
/* rearrange to display new window */
|
||||
arrange(awesomeconf);
|
||||
if(newscreen != -1)
|
||||
arrange(&awesomeconf[newscreen - awesomeconf->screen]);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
2
config.c
2
config.c
|
@ -283,6 +283,7 @@ parse_config(const char *confpatharg, awesome_config *awesomeconf)
|
|||
CFG_STR((char *) "name", (char *) "", CFGF_NONE),
|
||||
CFG_STR((char *) "tags", (char *) "", CFGF_NONE),
|
||||
CFG_BOOL((char *) "float", cfg_false, CFGF_NONE),
|
||||
CFG_INT((char *) "screen", -1, CFGF_NONE),
|
||||
CFG_END()
|
||||
};
|
||||
static cfg_opt_t rules_opts[] =
|
||||
|
@ -452,6 +453,7 @@ parse_config(const char *confpatharg, awesome_config *awesomeconf)
|
|||
if(!a_strlen(awesomeconf->rules[i].tags))
|
||||
awesomeconf->rules[i].tags = NULL;
|
||||
awesomeconf->rules[i].isfloating = cfg_getbool(cfgsectmp, "float");
|
||||
awesomeconf->rules[i].screen = cfg_getint(cfgsectmp, "screen");
|
||||
}
|
||||
|
||||
compileregs(awesomeconf->rules, awesomeconf->nrules);
|
||||
|
|
2
config.h
2
config.h
|
@ -40,6 +40,7 @@ typedef struct
|
|||
{
|
||||
char *prop;
|
||||
char *tags;
|
||||
int screen;
|
||||
Bool isfloating;
|
||||
regex_t *propregex;
|
||||
regex_t *tagregex;
|
||||
|
@ -165,7 +166,6 @@ struct awesome_config
|
|||
int ntags;
|
||||
/** Layout list */
|
||||
Layout *layouts;
|
||||
/** Number of layouts in *layouts */
|
||||
int nlayouts;
|
||||
/** Rules list */
|
||||
Rule *rules;
|
||||
|
|
15
tag.c
15
tag.c
|
@ -22,14 +22,15 @@
|
|||
#include <stdio.h>
|
||||
#include <X11/Xutil.h>
|
||||
|
||||
#include "screen.h"
|
||||
#include "layout.h"
|
||||
#include "tag.h"
|
||||
#include "util.h"
|
||||
|
||||
void
|
||||
int
|
||||
applyrules(Client *c, awesome_config *awesomeconf)
|
||||
{
|
||||
int i, j, len = 0;
|
||||
int i, j, screen = -1, len = 0;
|
||||
regmatch_t tmp;
|
||||
Bool matched = False;
|
||||
XClassHint ch = { 0, 0 };
|
||||
|
@ -56,6 +57,14 @@ applyrules(Client * c, awesome_config *awesomeconf)
|
|||
}
|
||||
else
|
||||
c->tags[j] = False;
|
||||
if(awesomeconf->rules[i].screen != -1
|
||||
&& awesomeconf->rules[i].screen != awesomeconf->screen)
|
||||
{
|
||||
screen = awesomeconf->rules[i].screen;
|
||||
move_client_to_screen(c,
|
||||
&awesomeconf[awesomeconf->rules[i].screen - awesomeconf->screen],
|
||||
True);
|
||||
}
|
||||
}
|
||||
p_delete(&prop);
|
||||
if(ch.res_class)
|
||||
|
@ -65,6 +74,8 @@ applyrules(Client * c, awesome_config *awesomeconf)
|
|||
if(!matched)
|
||||
for(i = 0; i < awesomeconf->ntags; i++)
|
||||
c->tags[i] = awesomeconf->tags[i].selected;
|
||||
|
||||
return screen;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in New Issue