diff options
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp index 1493bcd..2a85617 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,6 +1,7 @@ #include "widget.h" #include "main.h" -#include "x.h" +#include "xx.h" +#include "bus.h" #include <QApplication> #include <QLibraryInfo> @@ -8,7 +9,7 @@ #include <QCommandLineParser> namespace { -bool _testMode, _autoSetup, _showGui, _backgroundMode; +bool _testMode, _autoSetup, _showGui, _backgroundMode, _wakeup; } namespace CommandLine @@ -37,6 +38,10 @@ int main(int argc, char *argv[]) parseCommandLine(a); + if (_wakeup) { + return Bus::inst()->registerService() ? 0 : 1; + } + ScreenMode currentMode; if (CommandLine::autoSetup()) { currentMode = ScreenSetup::inst()->setDefaultMode(CommandLine::testMode()); @@ -81,10 +86,15 @@ static void parseCommandLine(const QApplication &a) QCommandLineOption oTest(QStringList() << "t" << "test", QCoreApplication::translate("main", "Test mode, don't actually apply any changes.")); parser.addOption(oTest); + // Wakeup beamergui daemon via DBus connect + QCommandLineOption oWakeup(QStringList() << "w" << "wakeup", + QCoreApplication::translate("main", "Connect to system bus to trigger wakeup of wainting beamergui.")); + parser.addOption(oWakeup); // PARSE parser.process(a); _testMode = parser.isSet(oTest); _autoSetup = parser.isSet(oAutoSetup); _showGui = parser.isSet(oShowGui); _backgroundMode = parser.isSet(oBackground); + _wakeup = parser.isSet(oWakeup); } |