|
|
@ -389,7 +389,7 @@ static void invoke_swaybar(swayc_t *output, struct bar_config *bar, int output_i
|
|
|
|
list_add(output->bar_pids, pid);
|
|
|
|
list_add(output->bar_pids, pid);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void terminate_swaybars(list_t *pids) {
|
|
|
|
void terminate_swaybars(list_t *pids) {
|
|
|
|
int i, ret;
|
|
|
|
int i, ret;
|
|
|
|
pid_t *pid;
|
|
|
|
pid_t *pid;
|
|
|
|
for (i = 0; i < pids->length; ++i) {
|
|
|
|
for (i = 0; i < pids->length; ++i) {
|
|
|
@ -411,6 +411,16 @@ static void terminate_swaybars(list_t *pids) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void terminate_swaybg(pid_t pid) {
|
|
|
|
|
|
|
|
int ret = kill(pid, SIGTERM);
|
|
|
|
|
|
|
|
if (ret != 0) {
|
|
|
|
|
|
|
|
sway_log(L_ERROR, "Unable to terminate swaybg [pid: %d]", pid);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
int status;
|
|
|
|
|
|
|
|
waitpid(pid, &status, 0);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void load_swaybars(swayc_t *output, int output_idx) {
|
|
|
|
void load_swaybars(swayc_t *output, int output_idx) {
|
|
|
|
// Check for bars
|
|
|
|
// Check for bars
|
|
|
|
list_t *bars = create_list();
|
|
|
|
list_t *bars = create_list();
|
|
|
@ -496,13 +506,7 @@ void apply_output_config(struct output_config *oc, swayc_t *output) {
|
|
|
|
if (oc && oc->background) {
|
|
|
|
if (oc && oc->background) {
|
|
|
|
|
|
|
|
|
|
|
|
if (output->bg_pid != 0) {
|
|
|
|
if (output->bg_pid != 0) {
|
|
|
|
int ret = kill(output->bg_pid, SIGTERM);
|
|
|
|
terminate_swaybg(output->bg_pid);
|
|
|
|
if (ret != 0) {
|
|
|
|
|
|
|
|
sway_log(L_ERROR, "Unable to terminate swaybg [pid: %d]", output->bg_pid);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
int status;
|
|
|
|
|
|
|
|
waitpid(output->bg_pid, &status, 0);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
sway_log(L_DEBUG, "Setting background for output %d to %s", output_i, oc->background);
|
|
|
|
sway_log(L_DEBUG, "Setting background for output %d to %s", output_i, oc->background);
|
|
|
|