File tree 2 files changed +28
-2
lines changed
2 files changed +28
-2
lines changed Original file line number Diff line number Diff line change 1
1
import QtQuick 1.1
2
2
3
-
4
-
5
3
Item {
6
4
7
5
Image {
@@ -19,12 +17,39 @@ Item {
19
17
height: parent .height
20
18
fillMode: Image .PreserveAspectFit
21
19
20
+ MouseArea {
21
+ anchors .fill : parent
22
+ onClicked: widgetImage .runCommand ()
23
+ }
24
+
22
25
function switchImages (){
23
26
var nextImage = widgetImage .nextImage ;
24
27
widgetImage .nextImage = widgetImage .source ;
25
28
widgetImage .source = nextImage;
26
29
}
27
30
31
+ function sendNotification (){
32
+ console .log (" Clicked!" );
33
+ var service = dataEngine (" notifications" ).serviceForSource (" notification" );
34
+ var operation = service .operationDescription (" createNotification" );
35
+ operation[" appName" ] = " Min-Status-Widget" ;
36
+ operation[" appIcon" ] = plasmoid .file (" images" , " ok.png" );
37
+ operation[" summary" ] = " Something Happened!" ;
38
+ operation[" body" ] = " I'm assuming that this should be longer..." ;
39
+ operation[" timeout" ] = 3000 ;
40
+
41
+ service .startOperationCall (operation);
42
+ console .log (service .serviceReady (service));
43
+ }
44
+
45
+ function runCommand (){
46
+ widgetImage .source = widgetImage .workingImage ;
47
+ console .log (" Running Command..." );
48
+ var result = plasmoid .runCommand (" /home/jschindler/src/min-status-widget/resources/randomSuccess.sh" );
49
+ sendNotification ();
50
+ console .log (result);
51
+ }
52
+
28
53
Timer {
29
54
id: " myTimer"
30
55
interval: 500 ; running: true ; repeat: true
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ Icon=chronometer
6
6
X-Plasma-API =declarativeappletscript
7
7
X-Plasma-MainScript =ui/main.qml
8
8
X-Plasma-DefaultSize =65,65
9
+ X-Plasma-RequiredExtensions =LaunchApp
9
10
10
11
X-KDE-PluginInfo-Author =Jason Schindler
11
12
X-KDE-PluginInfo-Email [email protected]
You can’t perform that action at this time.
0 commit comments