]>
Dogcows Code - chaz/openbox/blob - src/main.cc
1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
4 @brief Main entry point for the application
8 # include "../config.h"
9 #endif // HAVE_CONFIG_H
14 #endif // HAVE_LOCALE_H
18 #endif // HAVE_STDIO_H
21 # include <sys/types.h>
23 #endif // HAVE_UNISTD_H
29 #include "otk/util.hh"
31 int main(int argc
, char **argv
) {
32 // initialize the locale
33 if (!setlocale(LC_ALL
, ""))
34 printf("Couldn't set locale from environment.\n");
35 bindtextdomain(PACKAGE
, LOCALEDIR
);
36 bind_textdomain_codeset(PACKAGE
, "UTF-8");
39 ob::Openbox
openbox(argc
, argv
);
42 if (openbox
.doRestart()) {
43 const std::string
&prog
= openbox
.restartProgram();
45 execl("/bin/sh", "/bin/sh", "-c", prog
.c_str(), NULL
);
49 // fall back in case the above execlp doesn't work
50 execvp(argv
[0], argv
);
51 execvp(otk::basename(argv
[0]).c_str(), argv
);
This page took 0.034969 seconds and 4 git commands to generate.