diff options
author | 2015-08-09 14:03:54 -0400 | |
---|---|---|
committer | 2015-08-09 14:03:54 -0400 | |
commit | b075b06478cfc3c9b4f37ce171d8cde9b09f30ae (patch) | |
tree | b1ce75c334c7ef29c8c1c5f8b88488963f5207d8 | |
parent | Set DISPLAY to :1 automatically (diff) | |
download | sway-b075b06478cfc3c9b4f37ce171d8cde9b09f30ae.tar.gz sway-b075b06478cfc3c9b4f37ce171d8cde9b09f30ae.tar.zst sway-b075b06478cfc3c9b4f37ce171d8cde9b09f30ae.zip |
Load config after xwayland is created
This lets us run x commands on startup
-rw-r--r-- | sway/commands.c | 3 | ||||
-rw-r--r-- | sway/main.c | 4 |
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) { | |||
73 | 73 | ||
74 | int cmd_exec(struct sway_config *config, int argc, char **argv) { | 74 | int cmd_exec(struct sway_config *config, int argc, char **argv) { |
75 | if (argc < 1) { | 75 | if (argc < 1) { |
76 | sway_log(L_ERROR, "Invalid exit command (expected 1 arguments, got %d)", argc); | 76 | sway_log(L_ERROR, "Invalid exec command (expected at least 1 argument, got %d)", argc); |
77 | return 1; | 77 | return 1; |
78 | } | 78 | } |
79 | if (fork() == 0) { | 79 | if (fork() == 0) { |
80 | char *args = join_args(argv, argc); | 80 | char *args = join_args(argv, argc); |
81 | sway_log(L_DEBUG, "Executing %s", args); | ||
81 | execl("/bin/sh", "sh", "-c", args, (char *)NULL); | 82 | execl("/bin/sh", "sh", "-c", args, (char *)NULL); |
82 | free(args); | 83 | free(args); |
83 | exit(0); | 84 | 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() { | |||
29 | 29 | ||
30 | int main(int argc, char **argv) { | 30 | int main(int argc, char **argv) { |
31 | init_log(L_DEBUG); // TODO: Control this with command line arg | 31 | init_log(L_DEBUG); // TODO: Control this with command line arg |
32 | load_config(); | ||
33 | init_layout(); | 32 | init_layout(); |
34 | 33 | ||
35 | static struct wlc_interface interface = { | 34 | static struct wlc_interface interface = { |
@@ -58,7 +57,10 @@ int main(int argc, char **argv) { | |||
58 | if (!wlc_init(&interface, argc, argv)) { | 57 | if (!wlc_init(&interface, argc, argv)) { |
59 | return 1; | 58 | return 1; |
60 | } | 59 | } |
60 | |||
61 | setenv("DISPLAY", ":1", 1); | 61 | setenv("DISPLAY", ":1", 1); |
62 | load_config(); | ||
63 | |||
62 | wlc_run(); | 64 | wlc_run(); |
63 | return 0; | 65 | return 0; |
64 | } | 66 | } |