mirror of
https://github.com/swaywm/sway.git
synced 2024-11-24 08:51:27 +00:00
i3-compat: use shell for spawning bar
This commit is contained in:
parent
75b2d0b105
commit
0b89b37af3
|
@ -236,10 +236,14 @@ static void invoke_swaybar(struct bar_config *bar) {
|
||||||
setenv("WAYLAND_SOCKET", wayland_socket_str, true);
|
setenv("WAYLAND_SOCKET", wayland_socket_str, true);
|
||||||
|
|
||||||
// run custom swaybar
|
// run custom swaybar
|
||||||
char *const cmd[] = {
|
const char *swaybarcmd =
|
||||||
bar->swaybar_command ? bar->swaybar_command : "swaybar",
|
bar->swaybar_command ? bar->swaybar_command : "exec swaybar";
|
||||||
"-b", bar->id, NULL};
|
int cmdlen = snprintf(NULL, 0, "%s -b %s", swaybarcmd, bar->id) + 1;
|
||||||
|
char *full_cmd = malloc(cmdlen);
|
||||||
|
sprintf(full_cmd, "%s -b %s", swaybarcmd, bar->id);
|
||||||
|
char *const cmd[] = {"sh", "-c", full_cmd};
|
||||||
execvp(cmd[0], cmd);
|
execvp(cmd[0], cmd);
|
||||||
|
free(full_cmd);
|
||||||
_exit(EXIT_FAILURE);
|
_exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
_exit(EXIT_SUCCESS);
|
_exit(EXIT_SUCCESS);
|
||||||
|
|
Loading…
Reference in a new issue