feat: add --workdir

This commit is contained in:
outfoxxed 2024-03-04 05:38:03 -08:00
parent 63180382be
commit 04c4cfe7e0
Signed by untrusted user: outfoxxed
GPG key ID: 4C88A185FB89301E
2 changed files with 7 additions and 0 deletions

View file

@ -21,7 +21,9 @@ int main(int argc, char** argv) {
parser.addVersionOption(); parser.addVersionOption();
auto configOption = QCommandLineOption({"c", "config"}, "Path to configuration file.", "path"); auto configOption = QCommandLineOption({"c", "config"}, "Path to configuration file.", "path");
auto workdirOption = QCommandLineOption({"d", "workdir"}, "Initial working directory.", "path");
parser.addOption(configOption); parser.addOption(configOption);
parser.addOption(workdirOption);
parser.process(app); parser.process(app);
QString configPath; QString configPath;
@ -39,6 +41,10 @@ int main(int argc, char** argv) {
return -1; return -1;
} }
if (parser.isSet(workdirOption)) {
QDir::setCurrent(parser.value(workdirOption));
}
QuickshellPlugin::initPlugins(); QuickshellPlugin::initPlugins();
// Base window transparency appears to be additive. // Base window transparency appears to be additive.

View file

@ -1,4 +1,5 @@
#include "qmlglobal.hpp" #include "qmlglobal.hpp"
#include <utility>
#include <qcontainerfwd.h> #include <qcontainerfwd.h>
#include <qcoreapplication.h> #include <qcoreapplication.h>