Remember input selections before an app gains focus
This commit is contained in:
1 parent
cd73dc6cfd
commit
2841563e6c
5 files changed
+148
-40
No files matched your search
@@ -0,0 +1,36 @@
|
||||
pragma Singleton
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
|
||||
Singleton {
|
||||
id: root
|
||||
property var state: ({})
|
||||
|
||||
function cycle() {
|
||||
if (watcher.running) watcher.write("cycle\n")
|
||||
}
|
||||
|
||||
// One reader and pending selection for every monitor's keyboard widget.
|
||||
Process {
|
||||
id: watcher
|
||||
command: ["/usr/bin/python", Quickshell.env("OMARCHY_PATH") + "/default/input-methods/indicator.py"]
|
||||
running: true
|
||||
stdinEnabled: true
|
||||
stdout: SplitParser {
|
||||
onRead: data => {
|
||||
try { root.state = JSON.parse(data) } catch (e) {}
|
||||
}
|
||||
}
|
||||
onExited: {
|
||||
root.state = ({})
|
||||
restart.restart()
|
||||
}
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: restart
|
||||
interval: 5000
|
||||
onTriggered: watcher.running = true
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user