summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/dialog.cpp9
-rw-r--r--src/globals.cpp1
-rw-r--r--src/globals.h4
3 files changed, 14 insertions, 0 deletions
diff --git a/src/dialog.cpp b/src/dialog.cpp
index 342da87..21c5620 100644
--- a/src/dialog.cpp
+++ b/src/dialog.cpp
@@ -4,6 +4,7 @@
#include <QDebug>
#include <QRegExp>
#include <QFile>
+#include <QProcess>
#include "ui_dialog.h"
#include "save_restore_session.h"
@@ -46,6 +47,14 @@ void Dialog::on_treeView_activated(QModelIndex index) {
// no valid session has been selected, do nothing
return;
}
+
+ // Run session start script
+ if (QFile::exists(sessionStartScript)) {
+ QProcess scriptProcess;
+ scriptProcess.start(sessionStartScript, QIODevice::ReadOnly);
+ scriptProcess.waitForFinished();
+ scriptProcess.close();
+ }
if (s->run()) {
writePVSSettings();
diff --git a/src/globals.cpp b/src/globals.cpp
index 31e54d5..8026752 100644
--- a/src/globals.cpp
+++ b/src/globals.cpp
@@ -13,6 +13,7 @@ QString runVmScript(binPath + "/run-virt.sh");
QString filterScript(binPath + "/xmlfilter.sh");
QString printerScript(etcPath + "/printer.sh");
QString scannerScript(etcPath + "/scanner.sh");
+QString sessionStartScript(VMCHOOSER_SESSION_START_SCRIPT);
const QString globalConfFile(etcPath + "/vmchooser.conf");
const QString userConfFile(userPath + "/vmchooser.conf");
diff --git a/src/globals.h b/src/globals.h
index d46db63..f32fc64 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -11,6 +11,8 @@
#define VMCHOOSER_X_SESSIONS_PATH "/usr/share/xsessions"
+#define VMCHOOSER_SESSION_START_SCRIPT "/opt/openslx/vmchooser/sessionstart"
+
#define VMCHOOSER_DEFAULT_WIDTH 500
#define VMCHOOSER_DEFAULT_HEIGHT 580
@@ -29,6 +31,8 @@ extern QString runVmScript;
extern QString filterScript;
extern QString printerScript;
extern QString scannerScript;
+// Script that is run before the xsession/vsession is started
+extern QString sessionStartScript;
extern const QString globalConfFile;
extern const QString userConfFile;