@@ -16,6 +16,15 @@ KCM.SimpleKCM {
16
16
property bool cfg_hideWidget: hideWidget .checked
17
17
property alias cfg_isEnabled: headerComponent .isEnabled
18
18
property alias cfg_enableDebug: enableDebug .checked
19
+ property alias cfg_enableDBusService: enableDBusService .checked
20
+ property alias cfg_pythonExecutable: pythonExecutable .text
21
+ property alias cfg_dBusPollingRate: dBusPollingRate .value
22
+
23
+ property string presetsDir: StandardPaths .writableLocation (
24
+ StandardPaths .HomeLocation ).toString ().substring (7 ) + " /.config/panel-colorizer/presets"
25
+ property string presetsBuiltinDir: Qt .resolvedUrl (" ./presets" ).toString ().substring (7 ) + " /"
26
+
27
+ property string dbusName: Plasmoid .metaData .pluginId + " .c" + Plasmoid .containment .id + " .w" + Plasmoid .id
19
28
20
29
header: ColumnLayout {
21
30
Components .Header {
@@ -27,6 +36,7 @@ KCM.SimpleKCM {
27
36
28
37
ColumnLayout {
29
38
Kirigami .FormLayout {
39
+ id: form
30
40
CheckBox {
31
41
Kirigami .FormData .label : i18n (" Hide widget:" )
32
42
id: hideWidget
@@ -41,6 +51,80 @@ KCM.SimpleKCM {
41
51
onCheckedChanged: cfg_enableDebug = checked
42
52
text: i18n (" Show debugging information" )
43
53
}
54
+
55
+ Kirigami .Separator {
56
+ Kirigami .FormData .isSection : true
57
+ Kirigami .FormData .label : i18n (" D-Bus Service" )
58
+ Layout .fillWidth : true
59
+ }
60
+
61
+ CheckBox {
62
+ Kirigami .FormData .label : i18n (" Enabled:" )
63
+ id: enableDBusService
64
+ checked: cfg_enableDBusService
65
+ onCheckedChanged: cfg_enableDBusService = checked
66
+ text: i18n (" D-Bus name:" ) + " " + dbusName
67
+ }
68
+
69
+ Label {
70
+ text: i18n (" Each Panel Colorizer instance has its D-Bus name." )
71
+ wrapMode: Text .WordWrap
72
+ Layout .preferredWidth : 400
73
+ opacity: 0.6
74
+ }
75
+
76
+ TextField {
77
+ Kirigami .FormData .label : i18n (" Python 3 executable:" )
78
+ id: pythonExecutable
79
+ placeholderText: qsTr (" Python executable e.g. python, python3" )
80
+ enabled: enableDBusService .checked
81
+ }
82
+
83
+ Label {
84
+ text: i18n (" Required to run the D-Bus service in the background" )
85
+ wrapMode: Text .WordWrap
86
+ Layout .preferredWidth : 400
87
+ opacity: 0.6
88
+ }
89
+
90
+ SpinBox {
91
+ Kirigami .FormData .label : i18n (" Polling rate:" )
92
+ from: 10
93
+ to: 9999
94
+ stepSize: 100
95
+ id: dBusPollingRate
96
+ }
97
+
98
+ Label {
99
+ text: i18n (" How fast the widget reacts to D-Bus changes" )
100
+ wrapMode: Text .WordWrap
101
+ Layout .preferredWidth : 400
102
+ opacity: 0.6
103
+ }
104
+
105
+
106
+ Label {
107
+ Kirigami .FormData .label : i18n (" Usage:" )
108
+ text: i18n (" Apply a preset:" )
109
+ }
110
+
111
+ TextArea {
112
+ text: " qdbus6 " + dbusName + " /preset preset /path/to/preset/dir/"
113
+ readOnly: true
114
+ wrapMode: Text .WordWrap
115
+ Layout .preferredWidth : 400
116
+ }
117
+
118
+ Label {
119
+ text: i18n (" Preview and switch presets using fzf + qdbus6 + jq:" )
120
+ }
121
+
122
+ TextArea {
123
+ text: " find " + presetsBuiltinDir + " " + presetsDir + " -mindepth 1 -prune -type d | fzf --preview 'qdbus6 " + dbusName + " /preset preset {} && jq --color-output . {}/settings.json'"
124
+ readOnly: true
125
+ wrapMode: Text .WordWrap
126
+ Layout .preferredWidth : 400
127
+ }
44
128
}
45
129
}
46
130
}
0 commit comments