forked from Shinonome/dots-hyprland
use ipc calls more for compatibility
This commit is contained in:
@@ -25,7 +25,7 @@ Item {
|
|||||||
visible: Config.options.bar.utilButtons.showScreenSnip
|
visible: Config.options.bar.utilButtons.showScreenSnip
|
||||||
sourceComponent: CircleUtilButton {
|
sourceComponent: CircleUtilButton {
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
onClicked: Hyprland.dispatch("global quickshell:regionScreenshot")
|
onClicked: Quickshell.execDetached(["qs", "-p", Quickshell.shellPath(""), "ipc", "call", "region", "screenshot"]);
|
||||||
MaterialSymbol {
|
MaterialSymbol {
|
||||||
horizontalAlignment: Qt.AlignHCenter
|
horizontalAlignment: Qt.AlignHCenter
|
||||||
fill: 1
|
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 {
|
IpcHandler {
|
||||||
target: "lock"
|
target: "lock"
|
||||||
|
|
||||||
function activate(): void {
|
function activate(): void {
|
||||||
GlobalStates.screenLocked = true;
|
root.lock();
|
||||||
}
|
}
|
||||||
function focus(): void {
|
function focus(): void {
|
||||||
lockContext.shouldReFocus();
|
lockContext.shouldReFocus();
|
||||||
@@ -144,11 +152,7 @@ Scope {
|
|||||||
description: "Locks the screen"
|
description: "Locks the screen"
|
||||||
|
|
||||||
onPressed: {
|
onPressed: {
|
||||||
if (Config.options.lock.useHyprlock) {
|
root.lock()
|
||||||
Quickshell.execDetached(["bash", "-c", "pidof hyprlock || hyprlock"]);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
GlobalStates.screenLocked = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -165,7 +169,7 @@ Scope {
|
|||||||
function initIfReady() {
|
function initIfReady() {
|
||||||
if (!Config.ready || !Persistent.ready) return;
|
if (!Config.ready || !Persistent.ready) return;
|
||||||
if (Config.options.lock.launchOnStartup && Persistent.isNewHyprlandInstance) {
|
if (Config.options.lock.launchOnStartup && Persistent.isNewHyprlandInstance) {
|
||||||
Hyprland.dispatch("global quickshell:lock")
|
root.lock();
|
||||||
} else {
|
} else {
|
||||||
KeyringStorage.fetchKeyringData();
|
KeyringStorage.fetchKeyringData();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ RowLayout {
|
|||||||
Layout.bottomMargin: 4
|
Layout.bottomMargin: 4
|
||||||
onClicked: {
|
onClicked: {
|
||||||
GlobalStates.overviewOpen = false;
|
GlobalStates.overviewOpen = false;
|
||||||
Hyprland.dispatch("global quickshell:regionSearch")
|
Quickshell.execDetached(["qs", "-p", Quickshell.shellPath(""), "ipc", "call", "region", "search"]);
|
||||||
}
|
}
|
||||||
text: "image_search"
|
text: "image_search"
|
||||||
StyledToolTip {
|
StyledToolTip {
|
||||||
|
|||||||
+1
-1
@@ -23,7 +23,7 @@ AndroidQuickToggleButton {
|
|||||||
interval: 300
|
interval: 300
|
||||||
repeat: false
|
repeat: false
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
Hyprland.dispatch("global quickshell:regionScreenshot")
|
Quickshell.execDetached(["qs", "-p", Quickshell.shellPath(""), "ipc", "call", "region", "screenshot"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user