fix for start to non-gui system (QApplication)

master
const an teen 2022-02-11 03:50:27 -05:00
parent 304d917fd2
commit 3d56e593a6
2 changed files with 9 additions and 2 deletions

View File

@ -16,7 +16,12 @@ int main(int argc, char *argv[])
return 1;
}
QApplication a(argc, argv);
// To start QApplication without X-server (non-GUI system) should use:
// "export QT_QPA_PLATFORM=offscreen" in plain shell
// or
// "Environment=QT_QPA_PLATFORM=offscreen" in systemd service ([Service] section)
QApplication a(argc, argv, false);
QString configFile;
for (int i = 1; i < argc; i++) {

View File

@ -8,7 +8,9 @@ Type=idle
User=USERNAME
# Change paths to actual (like a /srv/ircabot or something):
ExecStart=/path/to/ircabot -c /path/to/ircabot.conf
# To run on non-GUI system:
Environment=QT_QPA_PLATFORM=offscreen
Restart=on-failure
[Install]
WantedBy=multi-user.target
WantedBy=multi-user.target