Hello list,

the script below is from this forum entry.
https://linuxmusicians.com/viewtopic.php?f=4&t=19279

The request was to invoke non-session-manager (the GUI) and load a specified session.

Maybe there is a better way?

hgn


#!/bin/sh
#Invoke with  nsmopen.sh projectname
PROJECT=$1  #for better readability

eval $(nsmd --detach) #command returns a line to set the NSM_URL which we use to actually set it.

{
#keep in brackets so that PID and nsm are in the same group. otherwise wait below will complain
  non-session-manager --nsm-url $NSM_URL  &
  PID=$! #Remember to check when the GUI closes
}
sleep 1 #leave NSM time to start up. Otherwise you will see some glitched session display

#oscsend is part of liblo, which nsm depends on. So no extra program to install
oscsend $NSM_URL "/nsm/server/open" s $PROJECT
wait $PID
echo "GUI closed. Closing detached nsdm server"
oscsend $NSM_URL "/nsm/server/quit"


Reply via email to