# include "../config.h"
#endif
-#include "../version.h"
#include "openbox.hh"
#include "client.hh"
#include "screen.hh"
#include "otk/property.hh"
#include "otk/display.hh"
#include "otk/assassin.hh"
-#include "otk/util.hh" // TEMPORARY
+#include "otk/util.hh"
extern "C" {
#include <X11/cursorfont.h>
python_exec(SCRIPTDIR"/config.py"); // load openbox config values
// run all of the python scripts
python_exec(SCRIPTDIR"/builtins.py"); // builtin callbacks
- // run the user's script
- python_exec(_scriptfilepath.c_str());
+ // run the user's script or the system defaults if that fails
+ if (!python_exec(_scriptfilepath.c_str()))
+ python_exec(SCRIPTDIR"/defaults.py"); // system default bahaviors
// initialize all the screens
OBScreen *screen;
if (!_restart_prog.empty()) {
const std::string &dstr =
otk::OBDisplay::screenInfo(first_screen)->displayString();
- putenv(const_cast<char *>(dstr.c_str()));
+ otk::putenv(const_cast<char *>(dstr.c_str()));
execlp(_restart_prog.c_str(), _restart_prog.c_str(), NULL);
perror(_restart_prog.c_str());
}
void Openbox::showVersion()
{
- printf(_("Openbox - version %s\n"), OPENBOX_VERSION);
+ printf(_("Openbox - version %s\n"), VERSION);
printf(" (c) 2002 - 2002 Ben Jansens\n\n");
}
void Openbox::execute(int screen, const std::string &bin)
{
-#ifdef __EMX__
- // XXX: whats this for? windows?
- spawnlp(P_NOWAIT, "cmd.exe", "cmd.exe", "/c", bin.c_str(), NULL);
-#else // __EMX__
if (screen >= ScreenCount(otk::OBDisplay::display))
screen = 0;
- const std::string &dstr =
- otk::OBDisplay::screenInfo(screen)->displayString();
-
- if (! fork()) {
- setsid();
- int ret = putenv(const_cast<char *>(dstr.c_str()));
- assert(ret != -1);
- ret = execl("/bin/sh", "/bin/sh", "-c", bin.c_str(), NULL);
- exit(ret);
- }
-#endif // __EMX__
+ otk::bexec(bin, otk::OBDisplay::screenInfo(screen)->displayString());
}
}