picker: use hyprctl proc to get cursor on init

This commit is contained in:
2 * r + 2 * t 2026-03-12 21:28:36 +11:00
parent 3e0360401b
commit 96f54e7b70

View file

@ -5,6 +5,7 @@ import qs.services
import qs.config import qs.config
import Caelestia import Caelestia
import Quickshell import Quickshell
import Quickshell.Io
import Quickshell.Wayland import Quickshell.Wayland
import QtQuick import QtQuick
import QtQuick.Effects import QtQuick.Effects
@ -191,6 +192,17 @@ MouseArea {
} }
} }
Process {
running: true
command: ["hyprctl", "cursorpos", "-j"]
stdout: StdioCollector {
onStreamFinished: {
const pos = JSON.parse(text);
root.checkClientRects(pos.x - root.screen.x, pos.y - root.screen.y);
}
}
}
Loader { Loader {
id: screencopy id: screencopy