Print SWAYSOCK after it is set for this Sway instance

`log_env` attempts to query SWAYSOCK env variable before ipc server is initialized.
Also cleans up unused files from main.c
This commit is contained in:
Furkan Sahin 2024-09-22 15:48:38 -05:00
parent 63345977e2
commit eb680c8f88

View file

@ -13,7 +13,6 @@
#include <unistd.h> #include <unistd.h>
#include <wlr/util/log.h> #include <wlr/util/log.h>
#include <wlr/version.h> #include <wlr/version.h>
#include "sway/commands.h"
#include "sway/config.h" #include "sway/config.h"
#include "sway/server.h" #include "sway/server.h"
#include "sway/swaynag.h" #include "sway/swaynag.h"
@ -23,7 +22,6 @@
#include "ipc-client.h" #include "ipc-client.h"
#include "log.h" #include "log.h"
#include "stringop.h" #include "stringop.h"
#include "util.h"
static bool terminate_request = false; static bool terminate_request = false;
static int exit_value = 0; static int exit_value = 0;
@ -296,7 +294,6 @@ int main(int argc, char **argv) {
sway_log(SWAY_INFO, "wlroots version " WLR_VERSION_STR); sway_log(SWAY_INFO, "wlroots version " WLR_VERSION_STR);
log_kernel(); log_kernel();
log_distro(); log_distro();
log_env();
if (optind < argc) { // Behave as IPC client if (optind < argc) { // Behave as IPC client
if (optind != 1) { if (optind != 1) {
@ -346,6 +343,7 @@ int main(int argc, char **argv) {
} }
ipc_init(&server); ipc_init(&server);
log_env();
setenv("WAYLAND_DISPLAY", server.socket, true); setenv("WAYLAND_DISPLAY", server.socket, true);
if (!load_main_config(config_path, false, false)) { if (!load_main_config(config_path, false, false)) {