2 //import quickwidgets 1.0
7 height: childrenRect.height
12 function parse(stdout) {
14 var val = stdout.match(rx)
18 property string command: "sh -c \"cat /proc/meminfo | /bin/grep 'Active:'\""
19 property string label: "Value:"
20 property string textcolor: "white"
21 property real interval_in_sec: 5
24 txt.text = txt.stagedtxt
28 property string stagedtxt: ""
32 anchors.right: proclabel.right
35 verticalAlignment: Text.AlignVCenter
36 horizontalAlignment: Text.AlignRight
37 color: proclabel.textcolor
38 Behavior on stagedtxt {
40 NumberAnimation { target: txt; property: "opacity"; to: 0; duration: 300 }
41 ScriptAction { script: setText(); }
42 NumberAnimation { target: txt; property: "opacity"; to: 1; duration: 500 }
51 font.weight: Font.Bold
52 anchors.left: proclabel.left
55 verticalAlignment: Text.AlignVCenter
56 horizontalAlignment: Text.AlignLeft
57 color: proclabel.textcolor
62 command: proclabel.command
63 onCompleted: { txt.stagedtxt = parse(stdout);}
64 onFailed: { proclabel.color = "red"; txt.stagedtxt = stderr }
69 triggeredOnStart: true
70 running: runtime.isActiveWindow
72 interval: proclabel.interval_in_sec*1000
73 onTriggered: { process.run() }