aboutsummaryrefslogtreecommitdiff
path: root/sway
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2015-08-09 14:03:54 -0400
committerDrew DeVault <sir@cmpwn.com>2015-08-09 14:03:54 -0400
commitb075b06478cfc3c9b4f37ce171d8cde9b09f30ae (patch)
treeb1ce75c334c7ef29c8c1c5f8b88488963f5207d8 /sway
parent4924628ac241530d8e823e69d542f3e846d8b10c (diff)
Load config after xwayland is created
This lets us run x commands on startup
Diffstat (limited to 'sway')
-rw-r--r--sway/commands.c3
-rw-r--r--sway/main.c4
2 files changed, 5 insertions, 2 deletions
diff --git a/sway/commands.c b/sway/commands.c
index 6d8cd468..8030712e 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -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) {
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;
}
if (fork() == 0) {
char *args = join_args(argv, argc);
+ sway_log(L_DEBUG, "Executing %s", args);
execl("/bin/sh", "sh", "-c", args, (char *)NULL);
free(args);
exit(0);
diff --git a/sway/main.c b/sway/main.c
index 03c7e2b3..6e66ef3a 100644
--- a/sway/main.c
+++ b/sway/main.c
@@ -29,7 +29,6 @@ void load_config() {
int main(int argc, char **argv) {
init_log(L_DEBUG); // TODO: Control this with command line arg
- load_config();
init_layout();
static struct wlc_interface interface = {
@@ -58,7 +57,10 @@ int main(int argc, char **argv) {
if (!wlc_init(&interface, argc, argv)) {
return 1;
}
+
setenv("DISPLAY", ":1", 1);
+ load_config();
+
wlc_run();
return 0;
}