View Single Post
Posts: 986 | Thanked: 1,526 times | Joined on Jul 2010
#30
sigh, here it is. if you do this, then window() condition will match window title of the most recently opened app....

the file in question is:
/usr/share/lipstick-jolla-home-qt5/switcher/Switcher.qml

Code:
commit 4564109ada4d5e5f971bb3d173252ecc5a70ecff (HEAD -> master)
Author: Elliot Wolk <elliot.wolk@gmail.com>
Date:   Fri, 31 Jan 2020 15:28:14 -0500

    lipstick: write window title to /tmp/lipstick-window-title every time topmost window changes

diff --git a/CONFIG_FILES/%usr%share%lipstick-jolla-home-qt5%switcher%Switcher.qml b/CONFIG_FILES/%usr%share%lipstick-jolla-home-qt5%switcher%Switcher.qml
index e6d4f1b..1c7c4d4 100644
--- a/CONFIG_FILES/%usr%share%lipstick-jolla-home-qt5%switcher%Switcher.qml
+++ b/CONFIG_FILES/%usr%share%lipstick-jolla-home-qt5%switcher%Switcher.qml
@@ -294,10 +294,26 @@ SilicaFlickable {
         return count
     }
 
+    function writeFileOverHTTP(file, text) {
+        var request = new XMLHttpRequest();
+        request.open("PUT", "file://" + file, false);
+        request.send(text);
+        return request.status;
+    }
+
     Connections {
         target: Lipstick.compositor
         onMinimizeLaunchingWindows: switcherRoot.minimizeLaunchingWindows()
-        onTopmostWindowIdChanged: touchWindow(Lipstick.compositor.topmostWindowId)
+        onTopmostWindowIdChanged: {
+          var windowId = Lipstick.compositor.topmostWindowId
+          if(windowId > 0){
+            var window = Lipstick.compositor.windowForId(windowId)
+            if(window){
+              writeFileOverHTTP("/tmp/lipstick-window-title", window.title + "\n")
+            }
+          }
+          touchWindow(windowId)
+        }
     }
 
     function resetPosition(delay) {
__________________
~ teleshoes ~

Last edited by wolke; 2020-09-05 at 15:42.
 

The Following 3 Users Say Thank You to wolke For This Useful Post: