diff --git a/AUTHORS b/AUTHORS index 70b1c32..e0736fc 100644 --- a/AUTHORS +++ b/AUTHORS @@ -10,4 +10,5 @@ Runge, David / dvzrv (new-session-manager fork) # Individual Contributions in alphabetical surname order Meyer, Hermann / brummer -Picot, Mathieu / houston +Picot, Mathieu / houston +Berkelder, Rik diff --git a/CHANGELOG b/CHANGELOG index 1a44831..7f69f96 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,5 @@ v1.4 +nsmd command line option --load-session to directly load one (Berkelder, Rik) Better detection of clients that failed to launch leads to faster session startup (by 5 seconds) Users get informed by label if an executable is not present on the system or permission denied Fixed reply for listing sessions from a plain "Done." to proper reply path with empty string as terminal symbol "/reply", "/nsm/server/list", "" diff --git a/src/nsmd.cpp b/src/nsmd.cpp index 301348e..161c9a8 100644 --- a/src/nsmd.cpp +++ b/src/nsmd.cpp @@ -2305,9 +2305,10 @@ int main(int argc, char *argv[]) srand( (unsigned int) seconds ); } -// char *osc_port = "6666"; + //Command line parameters char *osc_port = NULL; const char *gui_url = NULL; + const char *load_session = NULL; static struct option long_options[] = { @@ -2316,6 +2317,7 @@ int main(int argc, char *argv[]) { "osc-port", required_argument, 0, 'p' }, { "gui-url", required_argument, 0, 'g' }, { "help", no_argument, 0, 'h' }, + { "load-session", required_argument, 0, 'l'}, { 0, 0, 0, 0 } }; @@ -2349,8 +2351,12 @@ int main(int argc, char *argv[]) DMESSAGE( "Going to connect to GUI at: %s", optarg ); gui_url = optarg; break; + case 'l': + DMESSAGE( "Loading existing session file %s", optarg); + load_session = optarg; + break; case 'h': - printf( "Usage: %s [--osc-port portnum] [--session-root path]\n\n", argv[0] ); + printf( "Usage: %s [--osc-port portnum] [--session-root path] [--load-session session-name]\n\n", argv[0] ); exit(0); break; } @@ -2425,6 +2431,14 @@ int main(int argc, char *argv[]) osc_server->add_method( NULL, NULL, OSC_NAME( null ),NULL, "" ); + if ( load_session ) + { + char *spath; + asprintf( &spath, "%s/%s", session_root, load_session); // Build the session path. --load-session works with --session-root + MESSAGE( "LOAD SESSION %s", spath); + load_session_file( spath ); + } + if ( detach ) { MESSAGE( "Detaching from console" );