Merge pull request #3905 from Airblader/bug-3903
Respect match criteria for exec command
This commit is contained in:
commit
110bdcbee5
|
@ -1207,10 +1207,26 @@ void cmd_kill(I3_CMD, const char *kill_mode_str) {
|
||||||
void cmd_exec(I3_CMD, const char *nosn, const char *command) {
|
void cmd_exec(I3_CMD, const char *nosn, const char *command) {
|
||||||
bool no_startup_id = (nosn != NULL);
|
bool no_startup_id = (nosn != NULL);
|
||||||
|
|
||||||
|
HANDLE_EMPTY_MATCH;
|
||||||
|
|
||||||
|
int count = 0;
|
||||||
|
owindow *current;
|
||||||
|
TAILQ_FOREACH(current, &owindows, owindows) {
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (count > 1) {
|
||||||
|
LOG("WARNING: Your criteria for the exec command match %d containers, "
|
||||||
|
"so the command will execute this many times.\n",
|
||||||
|
count);
|
||||||
|
}
|
||||||
|
|
||||||
|
TAILQ_FOREACH(current, &owindows, owindows) {
|
||||||
DLOG("should execute %s, no_startup_id = %d\n", command, no_startup_id);
|
DLOG("should execute %s, no_startup_id = %d\n", command, no_startup_id);
|
||||||
start_application(command, no_startup_id);
|
start_application(command, no_startup_id);
|
||||||
|
}
|
||||||
|
|
||||||
ysuccess(true);
|
ysuccess(count > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define CMD_FOCUS_WARN_CHILDREN \
|
#define CMD_FOCUS_WARN_CHILDREN \
|
||||||
|
|
Loading…
Reference in New Issue