README.txt
[gitlive] / WindowLog.js
index a0f15a7..8b24906 100644 (file)
@@ -62,7 +62,8 @@ WindowLog = {
             var app = aw.get_application();
             var pid = app.get_pid();
             //print("PID " + pid);
-            var cmd = File.realpath('/proc/'+ pid + '/exe');
+            //var cmd = File.realpath('/proc/'+ pid + '/exe');
+            var cmd = pid ? File.read('/proc/'+ pid + '/cmdline') : 'UNKNOWN';
             
             if (!this.win || (this.win && win != this.win)) { 
         
@@ -90,10 +91,31 @@ WindowLog = {
         var path = dir + (xDate.newDate()).format("/d") + ".log";
         var time = (xDate.newDate()).format("H:i:s ")
         
-        File.append (path, time + str + ' ' + cmd + "\n");
+        File.append (path, "\n" +time + str + ' ' + cmd );
+        
+
+        return;
+        var auth = imports.Netrc.Netrc.forHost('git.roojs.com');
+
+        // upload it..
+        new XMLHttpRequest({
+            url : 'http://www.roojs.com/admin.php/Roo/Mtrack_desktop_activity', // configurable?
+            method : 'POST',
+            params : {
+                cmd : cmd,
+                title : str,
+                start_dt : (xDate.newDate()).format("Y-m-d H:i:s")
+            },
+            user : auth.login,
+            password : auth.password,
+            async : true,
+            send : true   // run on ctor..
+        });
+        
+        
     }
     
 }
 
 
-  
\ No newline at end of file
+