aboutsummaryrefslogtreecommitdiff
path: root/src/main.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cc')
-rw-r--r--src/main.cc25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/main.cc b/src/main.cc
index b678738..4b4bdc5 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -216,14 +216,23 @@ static void showInfo(ostream &ostr) {
216} 216}
217 217
218struct Options { 218struct Options {
219 Options() : 219 Options() : xsync(false) {
220 session_display(getenv("DISPLAY")),
221 rc_path(std::string(getenv("HOME")) + "/." + realProgramName("fluxbox")),
222 rc_file(rc_path + "/init"),
223 xsync(false) {
224 220
221 const char* env;
222
223 env = getenv("DISPLAY");
224 if (env) {
225 session_display.assign(env);
226 }
227
228 env = getenv("HOME");
229 if (env) {
230 rc_path.assign(std::string(env) + "/." + realProgramName("fluxbox"));
231 rc_file = rc_path + "/init";
232 }
225 } 233 }
226 234
235
227 std::string session_display; 236 std::string session_display;
228 std::string rc_path; 237 std::string rc_path;
229 std::string rc_file; 238 std::string rc_file;
@@ -394,7 +403,11 @@ void updateConfigFilesIfNeeded(const std::string& rc_file) {
394 string commandargs = realProgramName("fluxbox-update_configs"); 403 string commandargs = realProgramName("fluxbox-update_configs");
395 commandargs += " -rc " + rc_file; 404 commandargs += " -rc " + rc_file;
396 405
397 system(commandargs.c_str()); 406 if (system(commandargs.c_str())) {
407 fbdbg << "running '"
408 << commandargs
409 << "' failed." << endl;
410 }
398 } 411 }
399} 412}
400 413