Load config after xwayland is created

This lets us run x commands on startup
This commit is contained in:
Drew DeVault 2015-08-09 14:03:54 -04:00
parent 4924628ac2
commit b075b06478
2 changed files with 5 additions and 2 deletions

View file

@ -73,11 +73,12 @@ int cmd_bindsym(struct sway_config *config, int argc, char **argv) {
int cmd_exec(struct sway_config *config, int argc, char **argv) { int cmd_exec(struct sway_config *config, int argc, char **argv) {
if (argc < 1) { if (argc < 1) {
sway_log(L_ERROR, "Invalid exit command (expected 1 arguments, got %d)", argc); sway_log(L_ERROR, "Invalid exec command (expected at least 1 argument, got %d)", argc);
return 1; return 1;
} }
if (fork() == 0) { if (fork() == 0) {
char *args = join_args(argv, argc); char *args = join_args(argv, argc);
sway_log(L_DEBUG, "Executing %s", args);
execl("/bin/sh", "sh", "-c", args, (char *)NULL); execl("/bin/sh", "sh", "-c", args, (char *)NULL);
free(args); free(args);
exit(0); exit(0);

View file

@ -29,7 +29,6 @@ void load_config() {
int main(int argc, char **argv) { int main(int argc, char **argv) {
init_log(L_DEBUG); // TODO: Control this with command line arg init_log(L_DEBUG); // TODO: Control this with command line arg
load_config();
init_layout(); init_layout();
static struct wlc_interface interface = { static struct wlc_interface interface = {
@ -58,7 +57,10 @@ int main(int argc, char **argv) {
if (!wlc_init(&interface, argc, argv)) { if (!wlc_init(&interface, argc, argv)) {
return 1; return 1;
} }
setenv("DISPLAY", ":1", 1); setenv("DISPLAY", ":1", 1);
load_config();
wlc_run(); wlc_run();
return 0; return 0;
} }