use ipc calls more for compatibility

This commit is contained in:
end-4
2025-11-06 22:59:09 +01:00
parent 2807bed255
commit 1a4b4b8bef
4 changed files with 14 additions and 10 deletions
@@ -25,7 +25,7 @@ Item {
visible: Config.options.bar.utilButtons.showScreenSnip
sourceComponent: CircleUtilButton {
Layout.alignment: Qt.AlignVCenter
onClicked: Hyprland.dispatch("global quickshell:regionScreenshot")
onClicked: Quickshell.execDetached(["qs", "-p", Quickshell.shellPath(""), "ipc", "call", "region", "screenshot"]);
MaterialSymbol {
horizontalAlignment: Qt.AlignHCenter
fill: 1
@@ -128,11 +128,19 @@ Scope {
}
}
function lock() {
if (Config.options.lock.useHyprlock) {
Quickshell.execDetached(["bash", "-c", "pidof hyprlock || hyprlock"]);
return;
}
GlobalStates.screenLocked = true;
}
IpcHandler {
target: "lock"
function activate(): void {
GlobalStates.screenLocked = true;
root.lock();
}
function focus(): void {
lockContext.shouldReFocus();
@@ -144,11 +152,7 @@ Scope {
description: "Locks the screen"
onPressed: {
if (Config.options.lock.useHyprlock) {
Quickshell.execDetached(["bash", "-c", "pidof hyprlock || hyprlock"]);
return;
}
GlobalStates.screenLocked = true;
root.lock()
}
}
@@ -165,7 +169,7 @@ Scope {
function initIfReady() {
if (!Config.ready || !Persistent.ready) return;
if (Config.options.lock.launchOnStartup && Persistent.isNewHyprlandInstance) {
Hyprland.dispatch("global quickshell:lock")
root.lock();
} else {
KeyringStorage.fetchKeyringData();
}
@@ -99,7 +99,7 @@ RowLayout {
Layout.bottomMargin: 4
onClicked: {
GlobalStates.overviewOpen = false;
Hyprland.dispatch("global quickshell:regionSearch")
Quickshell.execDetached(["qs", "-p", Quickshell.shellPath(""), "ipc", "call", "region", "search"]);
}
text: "image_search"
StyledToolTip {
@@ -23,7 +23,7 @@ AndroidQuickToggleButton {
interval: 300
repeat: false
onTriggered: {
Hyprland.dispatch("global quickshell:regionScreenshot")
Quickshell.execDetached(["qs", "-p", Quickshell.shellPath(""), "ipc", "call", "region", "screenshot"]);
}
}