-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
126 lines (101 loc) · 2.43 KB
/
main.cpp
File metadata and controls
126 lines (101 loc) · 2.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#include <QCoreApplication>
#include <QProcess>
#include <QDebug>
#include <QFile>
#include "threads.h"
QStringList qlist, qlist2;
bool compose = false;
bool openboxFix = false;
void windowManager()
{
QProcess *process = new QProcess();
QFile file("/usr/bin/startkde_override");
if(file.exists())
{
qlist << "/usr/bin/startkde_override";
process->start("bash", qlist);
}
else
{
QFile openbox("/usr/bin/openbox");
if(openbox.exists())
{
compose = true;
openboxFix = true;
process->start("openbox");
}
else
{
QFile xfwm4("/usr/bin/xfwm4");
if(xfwm4.exists())
{
compose = true;
process->start("xfwm4");
}
}
}
//Threads::sleep(5);
//process->start("xfwm4", qlist);
//
//process->start("kwin", qlist);
}
void dacoration()
{
//if (openboxFix) Threads::sleep(8);
QProcess *process = new QProcess();
QFile compton("/usr/bin/compton");
if (compton.exists())
{
QString username = qgetenv("USER");
QString conf = "/home/" + username + "/compton.conf";
QFile file(conf);
if (file.exists())
{
qlist2 << "--config" << conf;
process->start("compton", qlist2);
}
else
{
qlist2 << "--config" << "/usr/share/compton/compton.conf";
process->start("compton", qlist2);
}
}
else
{
qlist2 << "-c" << "-C" << "-t-5" << "-l-5" << "-r4.2" << "-o.55";
process->start("xcompmgr", qlist2);
}
}
void desktop()
{
QProcess *process = new QProcess();
process->start("synth-desktop");
}
void panel()
{
Threads::sleep(5);
QProcess *process2 = new QProcess();
process2->start("/usr/bin/synth-panel");
}
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
Threads *t1 = new Threads("desktop");
Threads *t2 = new Threads("windowManager");
Threads *t3 = new Threads("panel");
t1->run(desktop);
t2->run(windowManager);
t3->run(panel);
if (compose)
{
Threads *t4 = new Threads("compositor");
t4->run(dacoration);
}
if (openboxFix) {
Threads::sleep(5);
QProcess *process = new QProcess();
qlist << "--replace";
process->start("openbox", qlist);
}
return a.exec();
}