Initial commit.
[lxde/compton-conf.git] / compton-conf.cpp
CommitLineData
012d3267
HJYP
1#include "compton-conf.h"
2#include <QApplication>
3#include <QDir>
4#include <QFile>
5#include "maindialog.h"
6#include <libconfig.h>
7#include <stdio.h>
8
9int main(int argc, char** argv) {
10 QApplication app(argc, argv);
11
12 // find config file
13 QString userConfigFile = qgetenv("XDG_CONFIG_HOME");
14 if(userConfigFile.isEmpty()) {
15 userConfigFile = QDir::homePath();
16 userConfigFile += "/.config";
17 }
18 // QDir configDir = QDir(userConfigFile);
19 // if(!configDir.exists())
20 userConfigFile += "/compton.conf";
21
22 // load config file
23 config_t cfg;
24 config_init(&cfg);
25 if(config_read_file(&cfg, userConfigFile.toLocal8Bit().constData()) == CONFIG_FALSE) {
26 // loading user config file failed
27 // try our default example
28 }
29
30 MainDialog dlg(&cfg);
31 dlg.exec();
32 return 0;
33}