diff --git a/app.cpp b/app.cpp index 4021084..59ede6a 100644 --- a/app.cpp +++ b/app.cpp @@ -295,6 +295,19 @@ void App::Run() { CreateServerAuth(); StartServer(); + + + // Run setup script + if (cfg->getOption("xsetup_script") != "") { + const char* xsetup_cmd = cfg->getOption("xsetup_script").c_str(); + logStream << APPNAME << ": executing xsetup script '" << xsetup_cmd << "'" << endl; + char *tmp = new char[strlen(xsetup_cmd) + 60]; + sprintf(tmp, xsetup_cmd); + system(tmp); + delete [] tmp; + logStream << APPNAME << ": xsetup script '" << xsetup_cmd << "' finished." << endl; + } + #endif } diff --git a/cfg.cpp b/cfg.cpp index 599e7c9..1c2dc9a 100644 --- a/cfg.cpp +++ b/cfg.cpp @@ -41,6 +41,7 @@ Cfg::Cfg() options.insert(option("suspend_cmd","")); options.insert(option("sessionstart_cmd","")); options.insert(option("sessionstop_cmd","")); + options.insert(option("xsetup_script","")); options.insert(option("console_cmd","/usr/bin/xterm -C -fg white -bg black +sb -g %dx%d+%d+%d -fn %dx%d -T ""Console login"" -e /bin/sh -c ""/bin/cat /etc/issue; exec /bin/login""")); options.insert(option("screenshot_cmd","import -window root /slim.png")); options.insert(option("welcome_msg","Welcome to %host")); diff --git a/slim.conf b/slim.conf index 2c72255..aa72762 100644 --- a/slim.conf +++ b/slim.conf @@ -16,6 +16,11 @@ xauth_path /usr/bin/xauth # Xauth file for server authfile /var/run/slim.auth +# Optional script for X setup - to run commands after +# X starts but before the panels draw. This provides +# the ability to add custom commands, the same as one +# would by modifying the Xsetup_0 script in XDM. +#xsetup_script /etc/X11/Xsetup_0.sh # Activate numlock when slim starts. Valid values: on|off # numlock on