mirror of
https://github.com/labwc/labwc.git
synced 2025-11-02 09:01:47 -05:00
xwayland: support xinitrc scripts to configure server on launch (#1963)
This commit is contained in:
parent
e4afa10fe4
commit
14d9bbab90
6 changed files with 48 additions and 5 deletions
|
|
@ -261,8 +261,8 @@ session_environment_init(void)
|
|||
paths_destroy(&paths);
|
||||
}
|
||||
|
||||
static void
|
||||
run_session_script(const char *script)
|
||||
void
|
||||
session_run_script(const char *script)
|
||||
{
|
||||
struct wl_list paths;
|
||||
paths_config_create(&paths, script);
|
||||
|
|
@ -293,13 +293,13 @@ session_autostart_init(struct server *server)
|
|||
{
|
||||
/* Update dbus and systemd user environment, each may fail gracefully */
|
||||
update_activation_env(server, /* initialize */ true);
|
||||
run_session_script("autostart");
|
||||
session_run_script("autostart");
|
||||
}
|
||||
|
||||
void
|
||||
session_shutdown(struct server *server)
|
||||
{
|
||||
run_session_script("shutdown");
|
||||
session_run_script("shutdown");
|
||||
|
||||
/* Clear the dbus and systemd user environment, each may fail gracefully */
|
||||
update_activation_env(server, /* initialize */ false);
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
#include "common/macros.h"
|
||||
#include "common/mem.h"
|
||||
#include "config/rcxml.h"
|
||||
#include "config/session.h"
|
||||
#include "labwc.h"
|
||||
#include "node.h"
|
||||
#include "ssd.h"
|
||||
|
|
@ -1072,6 +1073,9 @@ sync_atoms(xcb_connection_t *xcb_conn)
|
|||
static void
|
||||
handle_server_ready(struct wl_listener *listener, void *data)
|
||||
{
|
||||
/* Fire an Xwayland startup script if one (or many) can be found */
|
||||
session_run_script("xinitrc");
|
||||
|
||||
xcb_connection_t *xcb_conn = xcb_connect(NULL, NULL);
|
||||
if (xcb_connection_has_error(xcb_conn)) {
|
||||
wlr_log(WLR_ERROR, "Failed to create xcb connection");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue