patch to allow exec_always in configure file
fixed indentation, updated docs
This commit is contained in:
committed by
Michael Stapelberg
parent
5555c0fd3b
commit
cc24a96e96
@ -147,6 +147,7 @@ stack-limit { return TOKSTACKLIMIT; }
|
||||
cols { /* yylval.number = STACK_LIMIT_COLS; */return TOKSTACKLIMIT; }
|
||||
rows { /* yylval.number = STACK_LIMIT_ROWS; */return TOKSTACKLIMIT; }
|
||||
exec { WS_STRING; return TOKEXEC; }
|
||||
exec_always { WS_STRING; return TOKEXEC_ALWAYS; }
|
||||
client.background { BEGIN(COLOR_COND); yylval.single_color = &config.client.background; return TOKSINGLECOLOR; }
|
||||
client.focused { BEGIN(COLOR_COND); yylval.color = &config.client.focused; return TOKCOLOR; }
|
||||
client.focused_inactive { BEGIN(COLOR_COND); yylval.color = &config.client.focused_inactive; return TOKCOLOR; }
|
||||
|
@ -518,6 +518,7 @@ void parse_file(const char *f) {
|
||||
%token TOKIPCSOCKET "ipc_socket"
|
||||
%token TOKRESTARTSTATE "restart_state"
|
||||
%token TOKEXEC "exec"
|
||||
%token TOKEXEC_ALWAYS "exec_always"
|
||||
%token <single_color> TOKSINGLECOLOR
|
||||
%token <color> TOKCOLOR
|
||||
%token TOKARROW "→"
|
||||
@ -590,6 +591,7 @@ line:
|
||||
| ipcsocket
|
||||
| restart_state
|
||||
| exec
|
||||
| exec_always
|
||||
| single_color
|
||||
| color
|
||||
| terminal
|
||||
@ -1036,6 +1038,15 @@ exec:
|
||||
}
|
||||
;
|
||||
|
||||
exec_always:
|
||||
TOKEXEC_ALWAYS STR
|
||||
{
|
||||
struct Autostart *new = smalloc(sizeof(struct Autostart));
|
||||
new->command = $2;
|
||||
TAILQ_INSERT_TAIL(&autostarts_always, new, autostarts_always);
|
||||
}
|
||||
;
|
||||
|
||||
terminal:
|
||||
TOKTERMINAL STR
|
||||
{
|
||||
|
10
src/main.c
10
src/main.c
@ -32,6 +32,9 @@ struct bindings_head *bindings;
|
||||
/* The list of exec-lines */
|
||||
struct autostarts_head autostarts = TAILQ_HEAD_INITIALIZER(autostarts);
|
||||
|
||||
/* The list of exec_always lines */
|
||||
struct autostarts_always_head autostarts_always = TAILQ_HEAD_INITIALIZER(autostarts_always);
|
||||
|
||||
/* The list of assignments */
|
||||
struct assignments_head assignments = TAILQ_HEAD_INITIALIZER(assignments);
|
||||
|
||||
@ -465,5 +468,12 @@ int main(int argc, char *argv[]) {
|
||||
}
|
||||
}
|
||||
|
||||
/* Autostarting exec_always-lines */
|
||||
struct Autostart *exec_always;
|
||||
TAILQ_FOREACH(exec_always, &autostarts_always, autostarts_always) {
|
||||
LOG("auto-starting (always!) %s\n", exec_always->command);
|
||||
start_application(exec_always->command);
|
||||
}
|
||||
|
||||
ev_loop(main_loop, 0);
|
||||
}
|
||||
|
Reference in New Issue
Block a user