This repository has been archived by the owner on Apr 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
plasma_beautifier_qt.cpp
136 lines (99 loc) · 2.95 KB
/
plasma_beautifier_qt.cpp
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
126
127
128
129
130
131
132
133
134
135
#include "plasma_beautifier_qt.h"
#include "./ui_plasma_beautifier_qt.h"
#include <QTextStream>
#include <QFile>
#include <iostream>
#include <fstream>
plasma_beautifier_qt::plasma_beautifier_qt(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::plasma_beautifier_qt)
{
ui->setupUi(this);
}
plasma_beautifier_qt::~plasma_beautifier_qt()
{
delete ui;
}
void plasma_beautifier_qt::on_pushButton_clicked()
{
system("plasmashell --version > /tmp/plasmashellversion");
std::ifstream plasmashellversion("/tmp/plasmashellversion");
std::ofstream plasmaversion("/tmp/plasmaversion");
for(int i=1;!plasmashellversion.eof();i++)
{
char c;
plasmashellversion>>c;
if(plasmashellversion.eof()) break;
if(i>=12) plasmaversion<<c;
}
plasmashellversion.close();
plasmaversion.close();
QFile inputFile("/tmp/plasmaversion");
inputFile.open(QIODevice::ReadOnly);
QTextStream in(&inputFile);
QString line = in.readAll();
inputFile.close();
ui->plasmaversion->setText(line);
}
void plasma_beautifier_qt::on_pushButton_2_clicked()
{
system("konsole -e /usr/lib/plasma-beautifier-qt/data/installlightly.sh&");
}
void plasma_beautifier_qt::on_pushButton_3_clicked()
{
system("cp -r /usr/lib/plasma-beautifier-qt/data/lightlyrc ~/.config/");
}
void plasma_beautifier_qt::on_pushButton_4_clicked()
{
system("systemsettings5 kcm_style&");
}
void plasma_beautifier_qt::on_pushButton_5_clicked()
{
system("tar -xvf /usr/lib/plasma-beautifier-qt/data/desktoptheme-DeepinV20-dark.tar.xz -C ~/");
}
void plasma_beautifier_qt::on_pushButton_6_clicked()
{
system("systemsettings5 kcm_desktoptheme&");
}
void plasma_beautifier_qt::on_pushButton_7_clicked()
{
system("konsole -e /usr/lib/plasma-beautifier-qt/data/installlightly.sh&");
}
void plasma_beautifier_qt::on_pushButton_8_clicked()
{
system("konsole -e /usr/lib/plasma-beautifier-qt/data/installklassy.sh&");
}
void plasma_beautifier_qt::on_pushButton_9_clicked()
{
system("cp -r /usr/lib/plasma-beautifier-qt/data/klassyrc ~/.config/");
}
void plasma_beautifier_qt::on_pushButton_10_clicked()
{
system("systemsettings5 kcm_kwindecoration&");
}
void plasma_beautifier_qt::on_pushButton_11_clicked()
{
system("mkdir -p ~/.local/share/color-schemes&&cp -r /usr/lib/plasma-beautifier-qt/data/Lightly-transparent.colors ~/.local/share/color-schemes/");
}
void plasma_beautifier_qt::on_pushButton_12_clicked()
{
system("systemsettings5 kcm_colors");
}
void plasma_beautifier_qt::on_pushButton_13_clicked()
{
system("killall plasmashell");
system("plasmashell&");
}
void plasma_beautifier_qt::on_pushButton_14_clicked()
{
system("killall kwin_x11");
system("kwin_x11&");
}
void plasma_beautifier_qt::on_pushButton_15_clicked()
{
this->hide();
}
void plasma_beautifier_qt::on_pushButton_16_clicked()
{
system("x-www-browser https://github.com/kde-yyds/plasma-beautifier-qt/issues/new &");
}