From a4a52efd32b693e0c85977f91cee3bd91b25885c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=B8lx?= Date: Tue, 9 Feb 2016 00:25:27 +0100 Subject: [PATCH] xsetup_cmd invocation, after X start --- app.cpp | 9 +++++++++ app.h | 1 + cfg.cpp | 1 + slim.conf | 1 + 4 files changed, 12 insertions(+) diff --git a/app.cpp b/app.cpp index eb7e05f..f287ca9 100644 --- a/app.cpp +++ b/app.cpp @@ -285,6 +285,7 @@ void App::Run() { CreateServerAuth(); StartServer(); + SetupServer(); #endif } @@ -984,6 +985,14 @@ int App::StartServer() { return ServerPID; } +int App::SetupServer() { + string setupCommand = cfg->getOption("xsetup_cmd"); + if (setupCommand != "") + logStream << APPNAME << ": Setting X up, using " << setupCommand << ": "; + int rc = system(setupCommand.c_str()); + logStream << WEXITSTATUS(rc) << endl; +} + jmp_buf CloseEnv; int IgnoreXIO(Display *d) { logStream << APPNAME << ": connection to X server lost." << endl; diff --git a/app.h b/app.h index 0bbd7ac..8efca69 100644 --- a/app.h +++ b/app.h @@ -72,6 +72,7 @@ class App { /* Server functions */ int StartServer(); + int SetupServer(); int ServerTimeout(int timeout, char *string); int WaitForServer(); diff --git a/cfg.cpp b/cfg.cpp index 02379f2..26e4de0 100644 --- a/cfg.cpp +++ b/cfg.cpp @@ -32,6 +32,7 @@ Cfg::Cfg() options.insert(option("default_path","/bin:/usr/bin:/usr/local/bin")); options.insert(option("default_xserver","/usr/bin/X")); options.insert(option("xserver_arguments","")); + options.insert(option("xsetup_cmd","")); options.insert(option("numlock","")); options.insert(option("daemon","")); options.insert(option("xauth_path","/usr/bin/xauth")); diff --git a/slim.conf b/slim.conf index c5f1d38..be6257c 100644 --- a/slim.conf +++ b/slim.conf @@ -3,6 +3,7 @@ default_path /bin:/usr/bin:/usr/local/bin default_xserver /usr/bin/X #xserver_arguments -dpi 75 +#xsetup_cmd /path/to/xrandr/script # Commands for halt, login, etc. halt_cmd /sbin/shutdown -h now