mirror of
https://github.com/labwc/labwc.git
synced 2025-11-02 09:01:47 -05:00
Update .clang-format
Align with wlroots style
This commit is contained in:
parent
96b5ab1fc1
commit
96e05057a3
32 changed files with 669 additions and 515 deletions
23
src/main.c
23
src/main.c
|
|
@ -1,25 +1,26 @@
|
|||
#include "common/spawn.h"
|
||||
#include "labwc.h"
|
||||
#include "theme/theme.h"
|
||||
#include "xbm/xbm.h"
|
||||
#include "common/spawn.h"
|
||||
|
||||
#include <cairo.h>
|
||||
#include <pango/pangocairo.h>
|
||||
|
||||
struct server server = { 0 };
|
||||
struct rcxml rc = { 0 };
|
||||
struct theme theme = { 0 };
|
||||
|
||||
static const char labwc_usage[] =
|
||||
"Usage: labwc [-h] [-s <startup-command>] [-c <config-file>]\n";
|
||||
|
||||
static void usage(void)
|
||||
static void
|
||||
usage(void)
|
||||
{
|
||||
printf("%s", labwc_usage);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
char *startup_cmd = NULL;
|
||||
char *config_file = NULL;
|
||||
|
|
@ -34,35 +35,35 @@ int main(int argc, char *argv[])
|
|||
startup_cmd = optarg;
|
||||
break;
|
||||
case 'h':
|
||||
/* fallthrough */
|
||||
default:
|
||||
usage();
|
||||
}
|
||||
}
|
||||
if (optind < argc)
|
||||
if (optind < argc) {
|
||||
usage();
|
||||
}
|
||||
|
||||
wlr_log_init(WLR_ERROR, NULL);
|
||||
rcxml_read(config_file);
|
||||
|
||||
/* Wayland requires XDG_RUNTIME_DIR to be set */
|
||||
if (!getenv("XDG_RUNTIME_DIR")) {
|
||||
wlr_log(WLR_ERROR, "XDG_RUNTIME_DIR is not set");
|
||||
wlr_log(WLR_ERROR, "XDG_RUNTIME_DIR is required to be set");
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* TODO: Catch signals. Maybe SIGHUP for reconfigure */
|
||||
|
||||
struct server server = { 0 };
|
||||
server_init(&server);
|
||||
server_start(&server);
|
||||
|
||||
theme_read(rc.theme_name);
|
||||
xbm_load(server.renderer);
|
||||
|
||||
if (startup_cmd)
|
||||
if (startup_cmd) {
|
||||
spawn_async_no_shell(startup_cmd);
|
||||
}
|
||||
|
||||
wl_display_run(server.wl_display);
|
||||
|
||||
server_finish(&server);
|
||||
rcxml_finish();
|
||||
pango_cairo_font_map_set_default(NULL);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue