From 57e3989185b8209a11d79bac477479019d515180 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Wed, 24 Sep 2025 23:48:47 +1000 Subject: plugin: add hypr extras (#690) * move machine * works * prevent duplicate refreshes * use instead of hyprctl proc --- modules/areapicker/Picker.qml | 26 ++++---------------------- modules/bar/popouts/KbLayout.qml | 2 +- 2 files changed, 5 insertions(+), 23 deletions(-) (limited to 'modules') diff --git a/modules/areapicker/Picker.qml b/modules/areapicker/Picker.qml index d51d1f3..1625ccf 100644 --- a/modules/areapicker/Picker.qml +++ b/modules/areapicker/Picker.qml @@ -5,7 +5,6 @@ import qs.services import qs.config import Caelestia import Quickshell -import Quickshell.Io import Quickshell.Wayland import QtQuick import QtQuick.Effects @@ -16,13 +15,10 @@ MouseArea { required property LazyLoader loader required property ShellScreen screen - property int borderWidth - property int rounding - property bool onClient - property real realBorderWidth: onClient ? borderWidth : 2 - property real realRounding: onClient ? rounding : 0 + property real realBorderWidth: onClient ? (Hypr.options["general:border_size"] ?? 1) : 2 + property real realRounding: onClient ? (Hypr.options["decoration:rounding"] ?? 0) : 0 property real ssx property real ssy @@ -89,6 +85,8 @@ MouseArea { cursorShape: Qt.CrossCursor Component.onCompleted: { + Hypr.extras.refreshOptions(); + // Break binding if frozen if (loader.freeze) clients = clients; @@ -186,22 +184,6 @@ MouseArea { } } - Process { - running: true - command: ["hyprctl", "-j", "getoption", "general:border_size"] - stdout: StdioCollector { - onStreamFinished: root.borderWidth = JSON.parse(text).int - } - } - - Process { - running: true - command: ["hyprctl", "-j", "getoption", "decoration:rounding"] - stdout: StdioCollector { - onStreamFinished: root.rounding = JSON.parse(text).int - } - } - Loader { id: screencopy diff --git a/modules/bar/popouts/KbLayout.qml b/modules/bar/popouts/KbLayout.qml index b12f2ef..4ecea9e 100644 --- a/modules/bar/popouts/KbLayout.qml +++ b/modules/bar/popouts/KbLayout.qml @@ -23,6 +23,6 @@ ColumnLayout { Layout.fillWidth: true text: qsTr("Switch layout") - onClicked: Quickshell.execDetached(["hyprctl", "switchxkblayout", "all", "next"]) + onClicked: Hypr.message("switchxkblayout all next") } } -- cgit v1.2.3-freya