2021-09-24 21:45:48 +01:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-only
|
2022-04-22 17:00:36 +01:00
|
|
|
#define _POSIX_C_SOURCE 200809L
|
2025-07-28 01:22:10 -04:00
|
|
|
#include <getopt.h>
|
2025-05-08 19:28:15 +09:00
|
|
|
#include <pango/pangocairo.h>
|
2022-10-06 21:54:49 +01:00
|
|
|
#include <signal.h>
|
2022-10-04 21:48:57 +01:00
|
|
|
#include <unistd.h>
|
2024-05-22 09:56:16 +09:00
|
|
|
#include "common/fd-util.h"
|
2020-10-31 15:41:06 +00:00
|
|
|
#include "common/font.h"
|
2020-11-01 22:22:15 +00:00
|
|
|
#include "common/spawn.h"
|
2025-08-17 16:01:50 -04:00
|
|
|
#include "config/rcxml.h"
|
2020-10-08 20:50:20 +01:00
|
|
|
#include "config/session.h"
|
2019-11-19 21:00:26 +00:00
|
|
|
#include "labwc.h"
|
2021-02-21 22:18:34 +00:00
|
|
|
#include "theme.h"
|
2025-09-24 20:25:27 +01:00
|
|
|
#include "translate.h"
|
2020-10-19 22:14:17 +01:00
|
|
|
#include "menu/menu.h"
|
2019-05-11 21:26:59 +01:00
|
|
|
|
2020-06-05 23:04:54 +01:00
|
|
|
struct rcxml rc = { 0 };
|
2019-12-16 21:19:50 +00:00
|
|
|
|
2022-10-06 21:54:26 +01:00
|
|
|
static const struct option long_options[] = {
|
|
|
|
|
{"config", required_argument, NULL, 'c'},
|
|
|
|
|
{"config-dir", required_argument, NULL, 'C'},
|
|
|
|
|
{"debug", no_argument, NULL, 'd'},
|
2022-10-06 21:54:49 +01:00
|
|
|
{"exit", no_argument, NULL, 'e'},
|
2022-10-06 21:54:26 +01:00
|
|
|
{"help", no_argument, NULL, 'h'},
|
config: support merging multiple config files
Add the -m|--merge-config command line option to iterate backwards over
XDG Base Dir paths and read config/theme files multiple times.
For example if both ~/.config/labwc/rc.xml and /etc/xdg/labwc/rc.xml
exist, the latter will be read first and then the former (if
--merge-config is enabled).
When $XDG_CONFIG_HOME is defined, make it replace (not augment)
$HOME/.config. Similarly, make $XDG_CONFIG_DIRS replace /etc/xdg when
defined.
XDG Base Dir Spec does not specify whether or not an application (or a
compositor!) should (a) define that only the file under the most important
base directory should be used, or (b) define rules for merging the
information from the different files.
ref: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
In the case of labwc there is a use-case for both positions, just to be
clear, the default behaviour, described by position (a) above, does NOT
change.
This change affects the following config/theme files:
- rc.xml
- menu.xml
- autostart
- environment
- themerc
- themerc-override
- Theme buttons, for example max.xbm
Instead of caching global config/theme directories, create lists of paths
(e.g. '/home/foo/.config/labwc/rc.xml', '/etc/xdg/labwc/rc.xml', etc).
This creates more common parsing logic and just reversing the direction
of iteration and breaks early if config-merge is not wanted.
Enable better fallback for themes. For example if a particular theme does
not exist in $HOME/.local/share/themes, it will be searched for in
~/.themes/ and so on. This also applies to theme buttons which now
fallback on an individual basis.
Avoid using stat() in most situations and just go straight to fopen().
Fixes #1406
2024-01-09 22:00:45 +00:00
|
|
|
{"merge-config", no_argument, NULL, 'm'},
|
2022-10-06 21:54:49 +01:00
|
|
|
{"reconfigure", no_argument, NULL, 'r'},
|
2022-10-06 21:54:26 +01:00
|
|
|
{"startup", required_argument, NULL, 's'},
|
2024-03-09 17:12:54 +00:00
|
|
|
{"session", required_argument, NULL, 'S'},
|
2022-10-06 21:54:26 +01:00
|
|
|
{"version", no_argument, NULL, 'v'},
|
|
|
|
|
{"verbose", no_argument, NULL, 'V'},
|
|
|
|
|
{0, 0, 0, 0}
|
|
|
|
|
};
|
|
|
|
|
|
2020-07-16 20:16:43 +01:00
|
|
|
static const char labwc_usage[] =
|
2022-04-22 17:00:36 +01:00
|
|
|
"Usage: labwc [options...]\n"
|
2022-10-06 21:54:26 +01:00
|
|
|
" -c, --config <file> Specify config file (with path)\n"
|
|
|
|
|
" -C, --config-dir <dir> Specify config directory\n"
|
|
|
|
|
" -d, --debug Enable full logging, including debug information\n"
|
2022-10-06 21:54:49 +01:00
|
|
|
" -e, --exit Exit the compositor\n"
|
2022-10-06 21:54:26 +01:00
|
|
|
" -h, --help Show help message and quit\n"
|
config: support merging multiple config files
Add the -m|--merge-config command line option to iterate backwards over
XDG Base Dir paths and read config/theme files multiple times.
For example if both ~/.config/labwc/rc.xml and /etc/xdg/labwc/rc.xml
exist, the latter will be read first and then the former (if
--merge-config is enabled).
When $XDG_CONFIG_HOME is defined, make it replace (not augment)
$HOME/.config. Similarly, make $XDG_CONFIG_DIRS replace /etc/xdg when
defined.
XDG Base Dir Spec does not specify whether or not an application (or a
compositor!) should (a) define that only the file under the most important
base directory should be used, or (b) define rules for merging the
information from the different files.
ref: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
In the case of labwc there is a use-case for both positions, just to be
clear, the default behaviour, described by position (a) above, does NOT
change.
This change affects the following config/theme files:
- rc.xml
- menu.xml
- autostart
- environment
- themerc
- themerc-override
- Theme buttons, for example max.xbm
Instead of caching global config/theme directories, create lists of paths
(e.g. '/home/foo/.config/labwc/rc.xml', '/etc/xdg/labwc/rc.xml', etc).
This creates more common parsing logic and just reversing the direction
of iteration and breaks early if config-merge is not wanted.
Enable better fallback for themes. For example if a particular theme does
not exist in $HOME/.local/share/themes, it will be searched for in
~/.themes/ and so on. This also applies to theme buttons which now
fallback on an individual basis.
Avoid using stat() in most situations and just go straight to fopen().
Fixes #1406
2024-01-09 22:00:45 +00:00
|
|
|
" -m, --merge-config Merge user config files/theme in all XDG Base Dirs\n"
|
2022-10-06 21:54:49 +01:00
|
|
|
" -r, --reconfigure Reload the compositor configuration\n"
|
2022-10-06 21:54:26 +01:00
|
|
|
" -s, --startup <command> Run command on startup\n"
|
2024-03-09 17:12:54 +00:00
|
|
|
" -S, --session <command> Run command on startup and terminate on exit\n"
|
2022-10-06 21:54:26 +01:00
|
|
|
" -v, --version Show version number and quit\n"
|
|
|
|
|
" -V, --verbose Enable more verbose logging\n";
|
2020-07-16 20:16:43 +01:00
|
|
|
|
2020-09-28 20:41:41 +01:00
|
|
|
static void
|
|
|
|
|
usage(void)
|
2020-07-16 20:16:43 +01:00
|
|
|
{
|
|
|
|
|
printf("%s", labwc_usage);
|
|
|
|
|
exit(0);
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-28 17:35:08 +02:00
|
|
|
static void
|
|
|
|
|
print_version(void)
|
|
|
|
|
{
|
|
|
|
|
#define FEATURE_ENABLED(feature) (HAVE_##feature ? "+" : "-")
|
|
|
|
|
printf("labwc %s (%sxwayland %snls %srsvg %slibsfdo)\n",
|
|
|
|
|
LABWC_VERSION,
|
|
|
|
|
FEATURE_ENABLED(XWAYLAND),
|
|
|
|
|
FEATURE_ENABLED(NLS),
|
|
|
|
|
FEATURE_ENABLED(RSVG),
|
|
|
|
|
FEATURE_ENABLED(LIBSFDO)
|
|
|
|
|
);
|
|
|
|
|
#undef FEATURE_ENABLED
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-14 23:27:42 +01:00
|
|
|
static void
|
|
|
|
|
die_on_detecting_suid(void)
|
|
|
|
|
{
|
|
|
|
|
if (geteuid() != 0 && getegid() != 0) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (getuid() == geteuid() && getgid() == getegid()) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
wlr_log(WLR_ERROR, "SUID detected - aborting");
|
|
|
|
|
exit(EXIT_FAILURE);
|
|
|
|
|
}
|
|
|
|
|
|
2025-05-08 19:28:15 +09:00
|
|
|
static void
|
|
|
|
|
die_on_no_fonts(void)
|
|
|
|
|
{
|
|
|
|
|
PangoContext *context = pango_font_map_create_context(
|
|
|
|
|
pango_cairo_font_map_get_default());
|
|
|
|
|
PangoLayout *layout = pango_layout_new(context);
|
|
|
|
|
pango_layout_set_text(layout, "abcdefg", -1);
|
|
|
|
|
int nr_unknown_glyphs = pango_layout_get_unknown_glyphs_count(layout);
|
|
|
|
|
g_object_unref(layout);
|
|
|
|
|
g_object_unref(context);
|
|
|
|
|
|
|
|
|
|
if (nr_unknown_glyphs > 0) {
|
|
|
|
|
wlr_log(WLR_ERROR, "no fonts are available");
|
|
|
|
|
exit(EXIT_FAILURE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Make pango's dedicated thread exit. This prevents CI failures due to
|
|
|
|
|
* SIGTERM delivered to the pango's thread. This kind of workaround is
|
|
|
|
|
* not needed after we register our SIGTERM handler in
|
|
|
|
|
* server_init() > wl_event_loop_add_signal(), which masks SIGTERM.
|
|
|
|
|
*/
|
|
|
|
|
pango_cairo_font_map_set_default(NULL);
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-06 21:54:49 +01:00
|
|
|
static void
|
|
|
|
|
send_signal_to_labwc_pid(int signal)
|
|
|
|
|
{
|
|
|
|
|
char *labwc_pid = getenv("LABWC_PID");
|
|
|
|
|
if (!labwc_pid) {
|
|
|
|
|
wlr_log(WLR_ERROR, "LABWC_PID not set");
|
|
|
|
|
exit(EXIT_FAILURE);
|
|
|
|
|
}
|
|
|
|
|
int pid = atoi(labwc_pid);
|
|
|
|
|
if (!pid) {
|
|
|
|
|
wlr_log(WLR_ERROR, "should not send signal to pid 0");
|
|
|
|
|
exit(EXIT_FAILURE);
|
|
|
|
|
}
|
|
|
|
|
kill(pid, signal);
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-04 22:17:24 +02:00
|
|
|
struct idle_ctx {
|
|
|
|
|
struct server *server;
|
|
|
|
|
const char *primary_client;
|
|
|
|
|
const char *startup_cmd;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
idle_callback(void *data)
|
|
|
|
|
{
|
2025-01-08 23:35:23 -04:00
|
|
|
/* Idle callbacks destroy automatically once triggered */
|
2024-05-04 22:17:24 +02:00
|
|
|
struct idle_ctx *ctx = data;
|
|
|
|
|
|
|
|
|
|
/* Start session-manager if one is specified by -S|--session */
|
|
|
|
|
if (ctx->primary_client) {
|
|
|
|
|
ctx->server->primary_client_pid = spawn_primary_client(ctx->primary_client);
|
|
|
|
|
if (ctx->server->primary_client_pid < 0) {
|
|
|
|
|
wlr_log(WLR_ERROR, "fatal error starting primary client: %s",
|
|
|
|
|
ctx->primary_client);
|
|
|
|
|
wl_display_terminate(ctx->server->wl_display);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
session_autostart_init(ctx->server);
|
|
|
|
|
if (ctx->startup_cmd) {
|
|
|
|
|
spawn_async_no_shell(ctx->startup_cmd);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-28 20:41:41 +01:00
|
|
|
int
|
|
|
|
|
main(int argc, char *argv[])
|
2019-12-27 21:22:45 +00:00
|
|
|
{
|
2019-05-11 21:26:59 +01:00
|
|
|
char *startup_cmd = NULL;
|
2024-03-09 17:12:54 +00:00
|
|
|
char *primary_client = NULL;
|
2021-03-06 11:38:17 +00:00
|
|
|
enum wlr_log_importance verbosity = WLR_ERROR;
|
2020-05-11 06:59:27 +01:00
|
|
|
|
2019-05-11 21:26:59 +01:00
|
|
|
int c;
|
2022-10-06 21:54:26 +01:00
|
|
|
while (1) {
|
|
|
|
|
int index = 0;
|
2024-03-09 17:12:54 +00:00
|
|
|
c = getopt_long(argc, argv, "c:C:dehmrs:S:vV", long_options, &index);
|
2022-10-06 21:54:26 +01:00
|
|
|
if (c == -1) {
|
|
|
|
|
break;
|
|
|
|
|
}
|
2019-05-11 21:26:59 +01:00
|
|
|
switch (c) {
|
2020-07-18 11:28:39 +01:00
|
|
|
case 'c':
|
2024-01-18 19:45:49 +00:00
|
|
|
rc.config_file = optarg;
|
2020-07-18 11:28:39 +01:00
|
|
|
break;
|
2022-04-22 17:00:36 +01:00
|
|
|
case 'C':
|
config: support merging multiple config files
Add the -m|--merge-config command line option to iterate backwards over
XDG Base Dir paths and read config/theme files multiple times.
For example if both ~/.config/labwc/rc.xml and /etc/xdg/labwc/rc.xml
exist, the latter will be read first and then the former (if
--merge-config is enabled).
When $XDG_CONFIG_HOME is defined, make it replace (not augment)
$HOME/.config. Similarly, make $XDG_CONFIG_DIRS replace /etc/xdg when
defined.
XDG Base Dir Spec does not specify whether or not an application (or a
compositor!) should (a) define that only the file under the most important
base directory should be used, or (b) define rules for merging the
information from the different files.
ref: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
In the case of labwc there is a use-case for both positions, just to be
clear, the default behaviour, described by position (a) above, does NOT
change.
This change affects the following config/theme files:
- rc.xml
- menu.xml
- autostart
- environment
- themerc
- themerc-override
- Theme buttons, for example max.xbm
Instead of caching global config/theme directories, create lists of paths
(e.g. '/home/foo/.config/labwc/rc.xml', '/etc/xdg/labwc/rc.xml', etc).
This creates more common parsing logic and just reversing the direction
of iteration and breaks early if config-merge is not wanted.
Enable better fallback for themes. For example if a particular theme does
not exist in $HOME/.local/share/themes, it will be searched for in
~/.themes/ and so on. This also applies to theme buttons which now
fallback on an individual basis.
Avoid using stat() in most situations and just go straight to fopen().
Fixes #1406
2024-01-09 22:00:45 +00:00
|
|
|
rc.config_dir = optarg;
|
2022-04-22 17:00:36 +01:00
|
|
|
break;
|
2021-03-06 11:38:17 +00:00
|
|
|
case 'd':
|
|
|
|
|
verbosity = WLR_DEBUG;
|
|
|
|
|
break;
|
2022-10-06 21:54:49 +01:00
|
|
|
case 'e':
|
|
|
|
|
send_signal_to_labwc_pid(SIGTERM);
|
|
|
|
|
exit(0);
|
config: support merging multiple config files
Add the -m|--merge-config command line option to iterate backwards over
XDG Base Dir paths and read config/theme files multiple times.
For example if both ~/.config/labwc/rc.xml and /etc/xdg/labwc/rc.xml
exist, the latter will be read first and then the former (if
--merge-config is enabled).
When $XDG_CONFIG_HOME is defined, make it replace (not augment)
$HOME/.config. Similarly, make $XDG_CONFIG_DIRS replace /etc/xdg when
defined.
XDG Base Dir Spec does not specify whether or not an application (or a
compositor!) should (a) define that only the file under the most important
base directory should be used, or (b) define rules for merging the
information from the different files.
ref: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
In the case of labwc there is a use-case for both positions, just to be
clear, the default behaviour, described by position (a) above, does NOT
change.
This change affects the following config/theme files:
- rc.xml
- menu.xml
- autostart
- environment
- themerc
- themerc-override
- Theme buttons, for example max.xbm
Instead of caching global config/theme directories, create lists of paths
(e.g. '/home/foo/.config/labwc/rc.xml', '/etc/xdg/labwc/rc.xml', etc).
This creates more common parsing logic and just reversing the direction
of iteration and breaks early if config-merge is not wanted.
Enable better fallback for themes. For example if a particular theme does
not exist in $HOME/.local/share/themes, it will be searched for in
~/.themes/ and so on. This also applies to theme buttons which now
fallback on an individual basis.
Avoid using stat() in most situations and just go straight to fopen().
Fixes #1406
2024-01-09 22:00:45 +00:00
|
|
|
case 'm':
|
|
|
|
|
rc.merge_config = true;
|
|
|
|
|
break;
|
2022-10-06 21:54:49 +01:00
|
|
|
case 'r':
|
|
|
|
|
send_signal_to_labwc_pid(SIGHUP);
|
|
|
|
|
exit(0);
|
2020-09-25 19:42:40 +01:00
|
|
|
case 's':
|
|
|
|
|
startup_cmd = optarg;
|
|
|
|
|
break;
|
2024-03-09 17:12:54 +00:00
|
|
|
case 'S':
|
|
|
|
|
primary_client = optarg;
|
|
|
|
|
break;
|
2020-10-23 20:08:56 +01:00
|
|
|
case 'v':
|
2025-06-28 17:35:08 +02:00
|
|
|
print_version();
|
2021-03-06 11:38:17 +00:00
|
|
|
exit(0);
|
|
|
|
|
case 'V':
|
|
|
|
|
verbosity = WLR_INFO;
|
2020-10-23 20:08:56 +01:00
|
|
|
break;
|
2020-09-25 19:42:40 +01:00
|
|
|
case 'h':
|
2019-05-11 21:26:59 +01:00
|
|
|
default:
|
2020-07-16 20:16:43 +01:00
|
|
|
usage();
|
2019-05-11 21:26:59 +01:00
|
|
|
}
|
|
|
|
|
}
|
2020-09-28 20:41:41 +01:00
|
|
|
if (optind < argc) {
|
2020-07-16 20:16:43 +01:00
|
|
|
usage();
|
2020-09-28 20:41:41 +01:00
|
|
|
}
|
2019-05-11 21:26:59 +01:00
|
|
|
|
2021-03-06 11:38:17 +00:00
|
|
|
wlr_log_init(verbosity, NULL);
|
2020-10-08 20:50:20 +01:00
|
|
|
|
2022-10-14 23:27:42 +01:00
|
|
|
die_on_detecting_suid();
|
2025-05-08 19:28:15 +09:00
|
|
|
die_on_no_fonts();
|
2022-10-14 23:27:42 +01:00
|
|
|
|
config: support merging multiple config files
Add the -m|--merge-config command line option to iterate backwards over
XDG Base Dir paths and read config/theme files multiple times.
For example if both ~/.config/labwc/rc.xml and /etc/xdg/labwc/rc.xml
exist, the latter will be read first and then the former (if
--merge-config is enabled).
When $XDG_CONFIG_HOME is defined, make it replace (not augment)
$HOME/.config. Similarly, make $XDG_CONFIG_DIRS replace /etc/xdg when
defined.
XDG Base Dir Spec does not specify whether or not an application (or a
compositor!) should (a) define that only the file under the most important
base directory should be used, or (b) define rules for merging the
information from the different files.
ref: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
In the case of labwc there is a use-case for both positions, just to be
clear, the default behaviour, described by position (a) above, does NOT
change.
This change affects the following config/theme files:
- rc.xml
- menu.xml
- autostart
- environment
- themerc
- themerc-override
- Theme buttons, for example max.xbm
Instead of caching global config/theme directories, create lists of paths
(e.g. '/home/foo/.config/labwc/rc.xml', '/etc/xdg/labwc/rc.xml', etc).
This creates more common parsing logic and just reversing the direction
of iteration and breaks early if config-merge is not wanted.
Enable better fallback for themes. For example if a particular theme does
not exist in $HOME/.local/share/themes, it will be searched for in
~/.themes/ and so on. This also applies to theme buttons which now
fallback on an individual basis.
Avoid using stat() in most situations and just go straight to fopen().
Fixes #1406
2024-01-09 22:00:45 +00:00
|
|
|
session_environment_init();
|
2024-06-23 06:51:22 +09:00
|
|
|
|
|
|
|
|
#if HAVE_NLS
|
|
|
|
|
/* Initialize locale after setting env vars */
|
|
|
|
|
setlocale(LC_ALL, "");
|
|
|
|
|
bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR);
|
|
|
|
|
textdomain(GETTEXT_PACKAGE);
|
|
|
|
|
#endif
|
|
|
|
|
|
2024-01-18 19:45:49 +00:00
|
|
|
rcxml_read(rc.config_file);
|
2020-06-05 23:04:54 +01:00
|
|
|
|
2022-10-04 21:48:57 +01:00
|
|
|
/*
|
|
|
|
|
* Set environment variable LABWC_PID to the pid of the compositor
|
|
|
|
|
* so that SIGHUP and SIGTERM can be sent to specific instances using
|
|
|
|
|
* `kill -s <signal> <pid>` rather than `killall -s <signal> labwc`
|
|
|
|
|
*/
|
|
|
|
|
char pid[32];
|
|
|
|
|
snprintf(pid, sizeof(pid), "%d", getpid());
|
|
|
|
|
if (setenv("LABWC_PID", pid, true) < 0) {
|
|
|
|
|
wlr_log_errno(WLR_ERROR, "unable to set LABWC_PID");
|
|
|
|
|
} else {
|
|
|
|
|
wlr_log(WLR_DEBUG, "LABWC_PID=%s", pid);
|
|
|
|
|
}
|
|
|
|
|
|
2024-10-21 11:07:01 +10:00
|
|
|
/* useful for helper programs */
|
|
|
|
|
if (setenv("LABWC_VER", LABWC_VERSION, true) < 0) {
|
|
|
|
|
wlr_log_errno(WLR_ERROR, "unable to set LABWC_VER");
|
|
|
|
|
} else {
|
|
|
|
|
wlr_log(WLR_DEBUG, "LABWC_VER=%s", LABWC_VERSION);
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-11 06:59:27 +01:00
|
|
|
if (!getenv("XDG_RUNTIME_DIR")) {
|
2021-07-22 21:30:17 +01:00
|
|
|
wlr_log(WLR_ERROR, "XDG_RUNTIME_DIR is unset");
|
|
|
|
|
exit(EXIT_FAILURE);
|
2020-05-11 06:59:27 +01:00
|
|
|
}
|
|
|
|
|
|
2022-07-17 00:49:26 +00:00
|
|
|
increase_nofile_limit();
|
|
|
|
|
|
2020-09-28 20:41:41 +01:00
|
|
|
struct server server = { 0 };
|
2020-06-03 18:39:46 +01:00
|
|
|
server_init(&server);
|
|
|
|
|
server_start(&server);
|
2020-05-11 06:59:27 +01:00
|
|
|
|
2021-02-25 22:14:07 +00:00
|
|
|
struct theme theme = { 0 };
|
2024-04-21 02:30:31 +09:00
|
|
|
theme_init(&theme, &server, rc.theme_name);
|
2022-03-09 05:40:54 +01:00
|
|
|
rc.theme = &theme;
|
2021-02-21 21:54:40 +00:00
|
|
|
server.theme = &theme;
|
2020-06-29 19:27:59 +01:00
|
|
|
|
2022-12-06 11:54:55 +01:00
|
|
|
menu_init(&server);
|
2020-10-19 22:14:17 +01:00
|
|
|
|
2024-05-04 22:17:24 +02:00
|
|
|
/* Delay startup of applications until the event loop is ready */
|
|
|
|
|
struct idle_ctx idle_ctx = {
|
|
|
|
|
.server = &server,
|
|
|
|
|
.primary_client = primary_client,
|
|
|
|
|
.startup_cmd = startup_cmd
|
|
|
|
|
};
|
|
|
|
|
wl_event_loop_add_idle(server.wl_event_loop, idle_callback, &idle_ctx);
|
2020-07-16 20:16:43 +01:00
|
|
|
|
2019-05-11 21:26:59 +01:00
|
|
|
wl_display_run(server.wl_display);
|
2020-09-28 20:41:41 +01:00
|
|
|
|
2024-03-03 15:04:24 -05:00
|
|
|
session_shutdown(&server);
|
2024-02-18 12:23:14 -05:00
|
|
|
|
2023-10-09 20:59:04 +01:00
|
|
|
menu_finish(&server);
|
2021-02-21 22:03:14 +00:00
|
|
|
theme_finish(&theme);
|
2020-08-13 20:18:48 +01:00
|
|
|
rcxml_finish();
|
2020-10-31 15:41:06 +00:00
|
|
|
font_finish();
|
2024-11-12 07:46:08 +09:00
|
|
|
|
|
|
|
|
server_finish(&server);
|
|
|
|
|
|
2019-05-11 21:26:59 +01:00
|
|
|
return 0;
|
|
|
|
|
}
|