Skip to content

Commit 63ff8c8

Browse files
committed
0.6
1 parent b069b19 commit 63ff8c8

File tree

2 files changed

+29
-3
lines changed

2 files changed

+29
-3
lines changed

panes/panels.cpp

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,11 @@ PanelsPane::PanelsPane(QWidget *parent, Settings* controlCenter) :
198198
iconByApplet["launcher"] = "terminal";
199199
iconByApplet["battery"] = "extensions";
200200
iconByApplet["sni"] = "extensions";
201+
iconByApplet["clioutput"] = "terminal";
201202

202203
// Applet human-readable names
203204
nameByApplet["appmenu"] = "App Menu";
204-
nameByApplet["windowlis"] = "Window List";
205+
nameByApplet["windowlist"] = "Window List";
205206
nameByApplet["spacer"] = "Spacer";
206207
nameByApplet["workspaces"] = "Workspaces Indicator";
207208
nameByApplet["volume"] = "Volume Dial";
@@ -214,6 +215,7 @@ PanelsPane::PanelsPane(QWidget *parent, Settings* controlCenter) :
214215
nameByApplet["launcher"] = "Launcher";
215216
nameByApplet["battery"] = "Battery Indicator";
216217
nameByApplet["sni"] = "SNI tray";
218+
nameByApplet["clioutput"] = "CLI Output";
217219

218220

219221
for (qint8 i = 0; i < ui->availableAppletsListWidget->count(); ++i) {
@@ -355,7 +357,7 @@ PanelsPane::PanelsPane(QWidget *parent, Settings* controlCenter) :
355357
[this]() {
356358
foreach (QListWidgetItem* item, ui->availableAppletsListWidget->selectedItems()) {
357359
if (ui->enabledAppletsListWidget->findItems(item->text(), Qt::MatchExactly).isEmpty()) {
358-
if (item->text().startsWith("launcher")) {
360+
if (!item->text().compare("launcher")) {
359361
bool ok;
360362
QString filename = QInputDialog::getText(this,
361363
"Select app",
@@ -427,6 +429,25 @@ PanelsPane::PanelsPane(QWidget *parent, Settings* controlCenter) :
427429
ui->enabledAppletsListWidget->addItem(addedItem);
428430
}
429431
}
432+
433+
else if (!item->text().compare("clioutput")) {
434+
bool ok;
435+
QString filename = QInputDialog::getText(this,
436+
"Select config",
437+
"Type one of filenames from \n"
438+
"~/.config/plainDE/clioutput-applets/",
439+
QLineEdit::Normal,
440+
"",
441+
&ok);
442+
if (filename.endsWith(".json")) {
443+
filename.chop(5);
444+
}
445+
QListWidgetItem* addedItem = new QListWidgetItem;
446+
addedItem->setText("clioutput:" + filename);
447+
addedItem->setIcon(QIcon::fromTheme("terminal"));
448+
ui->enabledAppletsListWidget->addItem(addedItem);
449+
}
450+
430451
else {
431452
QListWidgetItem* addedItem = new QListWidgetItem;
432453
addedItem->setText(item->text());

panes/panels.ui

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<x>0</x>
88
<y>0</y>
99
<width>400</width>
10-
<height>520</height>
10+
<height>537</height>
1111
</rect>
1212
</property>
1313
<property name="windowTitle">
@@ -178,6 +178,11 @@
178178
<string>sni</string>
179179
</property>
180180
</item>
181+
<item>
182+
<property name="text">
183+
<string>clioutput</string>
184+
</property>
185+
</item>
181186
</widget>
182187
</item>
183188
<item>

0 commit comments

Comments
 (0)